Click() works in IE but not Firefox

前端 未结 5 1625
小鲜肉
小鲜肉 2020-12-05 12:08

I have code which is trivial but only works in IE not Firefox.

$(document).ready(function(){
    $(\'li#first\').click();
});

I have also t

5条回答
  •  再見小時候
    2020-12-05 12:49

    Firefox does support the .click() JQuery function. I had the same problem, until I specified the tag name in my selector. Essentially, I had something like this:

    ...
    $("#vidLeftArrow").click(function () {
       //Do something
    });
    

    Which didn't work. I had to change the javascript to this:

    ...
    $("a#vidLeftArrow").click(function () {
       //Do something
    });
    

提交回复
热议问题