Introduction to Event.preventdefault () usage
This method notifies the Web browser not to perform the default action associated with the event, if such an action exists. For example, if the Type property is "Submit," any event handle can be invoked at any stage of the event propagation, and by invoking the method, the form can be blocked. Note that if the Cancelable property of the Event object is Fasle, there is no default action, or the default action cannot be blocked. In either case, calling the method has no effect.
This method notifies the Web browser not to perform the default action associated with the event, if such an action exists.
For example, if the Type property is "Submit," any event handle can be invoked at any stage of the event propagation, and by invoking the method, the form can be blocked.
Note that if the Cancelable property of the Event object is Fasle, there is no default action, or the default action cannot be blocked. In either case, calling the method has no effect.
Introduction to Event.stoppropagation () usage
This method stops the propagation of the event and prevents it from being dispatched to another Document node. It can be invoked at any stage of the event propagation. Note that although this method cannot prevent other event handles from being invoked on the same Document node, it can prevent the dispatch of events to other nodes
This method stops the propagation of the event and prevents it from being dispatched to another Document node. It can be invoked at any stage of the event propagation.
Note: Although this method cannot prevent other event handles from being invoked on the same Document node, it can prevent the dispatch of events to other nodes.
The event is a DOM method of events, so it is not used alone, such as specifying DOM