How to know if the event.preventDefault method was used in an element?

We can use the event.defaultPrevented property in the event object. It returns a boolean indicating if the event.preventDefault() was called in a particular element.


November 02, 2022
2847