The example demonstrates bubbling when adding different event listeners Different from captured.
Click on the paragraph, I am bubble.
Click on the paragraph, I am capturing.
<script><br>function myP(e) {<br> alert("You clicked on the P element!");<br> window.event ? window.event.cancelBubble = true : e.stopPropagation();<br>}<br>function myDiv() {<br> alert("You clicked the DIV element!");<br>}<br>function myPa() {<br> alert("You clicked on the P2 element!");<br>}<br> function myDiva() {<br> alert("You clicked on the DIV2 element!");<br>} <br></script>