title: Exclude onclick() event from div
body: <p>I have this code:</p>
  <pre><code>&lt;body onclick=&quot;myFunction();&quot;&gt;
  &lt;head&gt;
  &lt;!-- some javascript here --&gt;
  &lt;body&gt;
  &lt;div id=&quot;element1&quot;&gt;
     &lt;div id=&quot;element2&quot;&gt;
        &lt;div id=&quot;element3&quot;&gt;
        &lt;/div&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  <p>Now I want to prevent the <code>onClick</code> on <code>&lt;body&gt;</code> triggering if the user clicks inside the <code>&lt;div id=&quot;element3&quot;&gt;</code> area.</p>
  <p>How I can do this?</p>