开发者

Remove and add class not working in FF

$('#resTable .wsButton').each(functi开发者_运维知识库on () {
    if ($(this).hasClass("btPrimary")) {
        $(this).removeAttr("href");
        $(this).removeClass("btPrimary");
        $(this).addClass("btPrimaryPrint");
    }
});

this code is workng in IE but not in FF. m i doing something wrong?


Put your code in:

$(document).ready(function(){
//your code here
});

it should work


view :

http://jsfiddle.net/Davood/CURCH/

http://jsfiddle.net/Davood/CURCH/1/

It's working on ie, ff and other browsers


just insert a comma between selector.

$('#resTable, .wsButton').each


I found the similar error but it get resolved when I kept the event handler method outside the (document).ready method since it was loading on page reload and not on that particular event. I hope I am clear

$(document).ready(function(){

});
//your code


Dude just replace your first line with :

$('#resTable, .wsButton').each(function () 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜