+ 2
it prevents the default behavior of an event. for example when you click on a link the default is to go to that link target. using preventDefault will cancel it and it will not follow the URL. NOTE: not all events can be canceled.
4th Feb 2019, 12:42 AM
Bahha┣
Bahha┣ - avatar
+ 2
Ali Tarek it's useful to prevent the things you don't want to happen when an event is triggered.
4th Feb 2019, 1:26 AM
Bahha┣
Bahha┣ - avatar