title: JavaScript onClick on embedded elements
body: <p>I have the following JavaScript:</p>
  <pre><code>&lt;div&gt;
      &lt;tr onClick=&quot;click1()&quot;&gt;
          &lt;td&gt;
              click 1
          &lt;/td&gt;
          &lt;td onClick=&quot;click2()&quot;&gt;
              click 2
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/div&gt;
  </code></pre>
  <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>function click1() {
    alert(1);
  }
  
  function click2() {
    alert(2);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table border="1"&gt;
    &lt;tr onClick="click1()"&gt;
      &lt;td&gt;
        click 1
      &lt;/td&gt;
      &lt;td onClick="click2()"&gt;
        click 2
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>If I click 'click 1', the <code>click1()</code> function is called as expected. If I click 'click 2', the <code>click1()</code> &amp; <code>click2()</code> functions are both called.</p>
  <p><strong>Question</strong></p>
  <p>How do I make the click on 'click 2' only call the <code>click2()</code> function, and not call the <code>click1()</code> function?</p>