I am trying to understand event bubbling, while try with my own code: `
<!DOCTYPE html>
<html>
<body>
<div onclick="alert('1')">
1
<div onclick="alert('2')">
2
<div onclick="alert('3')">3</div>
</div>
</div>
</body>
</html>
Here I saw that, when click div 3, it shows three alert (3 2 1). After I change the first div tag to P tag, I click that same div 3 it come up with only two alert (3 2). Here, why alert 1 is not coming since it is under the parent(P) tag.
After change first div tag to P tag, code looks like below:
<p onclick="alert('1')">
1
<div onclick="alert('2')">
2
<div onclick="alert('3')">3</div>
</div>
</p>