Apply click method to outer div but not inner div : <p>In this example I want the alert to be triggered when the black outer div is clicked but not when anything inside the inner div is clicked.</p>

<p>Currently when I click the inner button it triggers the alert.</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>$("#outer").click(function() {
  alert("triggered");
});</code></pre>
<pre class="snippet-code-css lang-css prettyprint-override"><code>#outer{
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}
#inner{
  background-color: #fff;
width: 300px;
height: 300px;
  text-align: center;
}</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;div id="outer"&gt;

  &lt;div id="inner"&gt;
    &lt;button&gt;inner button&lt;/button&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>I want inside the inner div nothing to trigger the alert.  How do i do this?</p>

<p>(for some reason inner button isn't showing in snippet, here is codepen link: <a href="https://codepen.io/GuerrillaCoder/pen/Pmvmqx" rel="noreferrer">https://codepen.io/GuerrillaCoder/pen/Pmvmqx</a>)</p>
