The following code is throwing two alerts as expected in IE but not in Firefox. Please help.
There's no click
method on elements. Are you using any library?
Usually you have to do something like element.fireEvent('click')
(prototype, mootools)
or element.click()
(jquery)
UPDATE- Similar question: How do I programmatically click on an element in JavaScript?
Looks like an ugly and brittle solution, if I were you I'd just include jQuery and let that handle all the browser quirks.