What is the execution order of inline events, attachEvent
handlers, and an <a>
tag's href
navigation?
views:
90answers:
2
+1
A:
The execution order of individual event handlers is undefined.
If none of the event handlers called e.preventDefault()
, and if onclick
didn't return false
, a navigation will occur.
SLaks
2010-05-21 03:00:08
I always thought tags event had priority over binded ones.
Ben
2010-05-21 03:04:57
@Ben: You might be right; I'm not sure. (Check the spec)
SLaks
2010-05-21 03:10:21
If using `attachEvent`, this implies IE, which means the event will have no `preventDefault` method. The equivalent is `e.returnValue = false;`.
Tim Down
2010-05-21 08:25:10
even the tag event return false, the binded handler still exec! thanks.
lovespring
2010-05-21 03:07:13