title: Disable click propagation for href
body: <p>This code snippet explains my case:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$("#b").click(function(e) {
    e.stopPropagation();
  });
  
  $("#b").click(function() {
    alert("trigger div");
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>a {
    display: block;
    position: relative;
    width: 100px;
    height: 100px;
    background-color: gray;
  }
  
  div {
    position: absolute;
    width: 50px;
    height: 50px;
    top: 0;
    left: 0;
    background-color: red;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;a href="stackoverflow.com" id="a"&gt;
    &lt;div id="b"&gt;Test&lt;/div&gt;
  &lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The problem is that I only want to trigger the click function from the <code>div</code> and not the <code>href</code> from the <code>a</code> tag. In a similar question I found <code>event.stopPropagation()</code>, but that does not work in this case.</p>