title: Remove the class from a parent element when clicking from inside the element
body: <p>I'm trying to figure out how I can remove a class on a parent when clicking within the element itself. Take this code below for example. I have an <code>on-click</code> event that adds a class on the parent or list element. Now if I created a click event within that element in order to remove a parent it will not work since it is inside the parent element. </p>
  
  <p>The javascript will assume that I'm clicking a parent but I'm actually clicking something inside the parent element.</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>$('ul li').on('click', function() {
      $(this).addClass('parent-class')
  })
  
  
  $('ul li span').on('click', function() {
      $('ul li').removeClass('parent-class')
  })</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>ul li {
      position : absolute;
      cursor : pointer;
  }
  
  ul li span {
    
  }</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;ul&gt;
      &lt;li&gt; Parent &lt;br/&gt;
          &lt;span class="remove-parent-class"&gt;
              Remove Parent Class
          &lt;/span&gt;
      &lt;/li&gt;
  &lt;/ul&gt;</code></pre>
  </div>
  </div>
  </p>