What's the difference between event.stopPropagation and event.preventDefault?
-
12-11-2019 - |
Pregunta
They seem to be doing the same thing... Is one modern and one old? Or are they supported by different browsers?
When I handle events myself (without framework) I just always check for both and execute both if present. (I also return false
, but I have the feeling that doesn't work with events attached with node.addEventListener
).
So why both? Should I keep checking for both? Or is there actually a difference?
(I know, a lot of questions, but they're all sort of the same =))
No hay solución correcta
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow