Click() works in IE but not Firefox

Posted by Tom Andrews on Stack Overflow See other posts from Stack Overflow or by Tom Andrews
Published on 2010-05-11T16:19:01Z Indexed on 2010/05/11 16:24 UTC
Read the original article Hit count: 160

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

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

I have also tried:

document.getElementById('first').click();

But that doesn't work either.

Is this an IE bug/feature or is click() not supported in the other browsers?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about ie

Related posts about JavaScript