0

What is the execution order of inline events, attachEvent handlers, and an <a> tag's href navigation?

0

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

I always thought tags event had priority over binded ones.
If using attachEvent, this implies IE, which means the event will have no preventDefault method. The equivalent is e.returnValue = false;.
-1

Try it yourself: http://jsfiddle.net/rhJ2f/

1 Comment

even the tag event return false, the binded handler still exec! thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.