title: Capture click event on parent container but not child
body: <p>With the following example:</p>
  
  <p><a href="https://i.stack.imgur.com/78wGa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/78wGa.png" alt="enter image description here"></a></p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="parent" onclick="alert('hello!')"&gt;
    &lt;div class="child"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>.parent {
    align-items: center;
    background: blue;
    display: flex;
    justify-content: center;
  }
  
  .child {
    background: pink;
    height: 100px;
    width: 200px;
  }
  </code></pre>
  
  <p>I want the <code>onclick</code> event to fire when the user clicks on the parent / blue section. But not when the user clicks on the child / pink section. Right now the event fires even when the pink is being clicked, which is of course obvious since the <code>.child</code> is a child of the parent. Is there any way to get past this?</p>