event.preventDefault() method cancels the event if it is cancelable, i.e., the default action of the event should not be taken as it normally would be.
event.preventDefault() method does not prevent further propagation of an event. Use the event.stopPropagation() or event.stopImmediatePropagation(), either of which terminates propagation at once.
Note: This method will have no effect for a non-cancelable event, such as one dispatched via element.dispatchEvent(), without specifying cancelable: true.
Please do google search for:
Join Our Channel
This channel is primarily useful for Full Stack Web Developer.