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?
Responding to comments:
- There is a single element with ID first, no more.
- It is an onclick on the list element that expands the element and moves focus on a Google Map element.
- Running the code in patrick's response (adding another click event to the element) produced some interesting behaviour. When running
$('li#first').click()
only the new event fired, but physically clicking the element with the mouse fired both (new and original).
Thanks in advance.