Home >Web Front-end >JS Tutorial >Getting Started with JQurey - An Example of the Bubbling Phenomenon in Event Mechanism_jquery
1. When the user browses the page , the browser will interpret or compile the page code - this process is essentially event-driven, that is, when the page is loaded, a Load event is executed. , in this event, the process of the browser compiling the page code is implemented. After the event is triggered, it is divided into two stages, one is Capture and the other is Bubbing. However, most browsers do not support the capture stage, so after the event is triggered, the bubbling process is often executed.
2. Sample code :
After clicking:
After clicking once, the number of execution times is shown to be 3 times. This is because the event has a bubbling phenomenon during the execution process, that is, although the click It's a button, but the event of the