fireEvent does not fire default handler?

B

Brian Genisio

Hi all,

Quick question... In IE, I noticed that if I call the fireEvent method
on an object, the default action does not get called.

For instance,

<a href="http://www.somewhere.com" id=myA><img src="someImg.jpg"
id=myImg></a>

if I call the following javascript:
document.getElementById("myImg").fireEvent("onclick")
or
document.getElementById("myA").fireEvent("onclick")

In both cases, it does not go to the URL in question.

If instead, I say document.getElementById("myImg").click(), the event
fires, AND it calls the default action, to go to the URL in question.

My question:
Does fireEvent _always_ cause the event to fire, without the default action?

Thanks,
Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top