20 What is the difference between stopPropagation and preventDefault

preview_player
Показать описание
What is the difference between stopPropagation and preventDefault

Stop propagation stops the event from proceeding down the event capturing phase or going up the event bubbling phase and no listeners will be called after the event has been told to stop propagating so going back to our example I've changed it slightly you'll see it's a check box now instead of a button as the fourth element. On the second item, we call stop propagation it doesn't go to the first item. On the third and fourth items which is the checkbox itself, we actually stopped the event from moving. We're doing this in the capturing phase but the same thing is valid in the bubbling phase.

THANKS FOR WATCHING AND DON'T FORGET TO LIKE, COMMENTS, SUBSCRIBE AND HIT THE BELL ICON TO WATCH LATEST VIDEO!
#edudreams #js #javscript #script

-~-~~-~~~-~~-~-
Please watch: "String manipulation in Python #codingtutorial #python #programminglanguage #coding"
-~-~~-~~~-~~-~-
Рекомендации по теме
Комментарии
Автор

awesome thank you. finally understood on practice what is the difference.

giorgieliozashvili