0

Sample Code is given below. When I click on DIV why is event of FORM element fired? Even I stop event bubbling of FORM elements

<!DOCTYPE HTML>
<html>

<head>
  <meta charset="utf-8">
</head>

<body>

  <style>
    body * {
      margin: 10px;
      border: 1px solid blue;
    }
  </style>

  <form onclick="event.stopPropagation();alert('form')">FORM
    <div>DIV
      <p onclick="event.stopPropagation();alert('p')">P</p>
    </div>
  </form>

</body>

</html>
Chinmoy Samanta
  • 1,376
  • 7
  • 17

0 Answers0