What is difference between return false; and e.preventDefault(); ?
Asked
Active
Viewed 357 times
2
Marcel Gwerder
- 8,165
- 5
- 34
- 59
SGh
- 127
- 2
- 9
1 Answers
0
e.preventDefault() will prevent the default event from occuring and return false stops propogation.
Rahul Tripathi
- 161,154
- 30
- 262
- 319
-
Wrong. `e.preventDefault()` prevents the default action (not event) from occurring, without stopping further propagation of the event. And on some browsers in some circumstances, `return false` does the same, but there isn't any W3C specification for this. – Oriol Sep 24 '13 at 01:32