title: Remove class of another element with jQuery when clicking element
body: <p>I am having an issue with my code.</p>
  
  <p>Currently the <code>.active</code> class is being applied when I click on divs that read ebook image 1, ebook image 2, ebook image 3, as intended.</p>
  
  <p>What I would like to do is to remove the <code>.active</code> class when I click the div itself, which it is not currently doing. </p>
  
  <p><a href="https://fiddle.jshell.net/aerandur/v20hmy3b/" rel="nofollow">https://fiddle.jshell.net/aerandur/v20hmy3b/</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    $('.one').on('click', function() {
      $('.one').removeClass('active');
      $id = "#" + $(this).addClass('active').attr('data-id');
      $('.two:not(' + $id + ')').hide();
      $($id).slideToggle();
    });
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>/* .container {
    margin: 0 auto;
  }
  
  .frame {
    max-width: 940px;
    margin: 0 auto;
  }
   */
  .one {
    top: 0;
    background-color: lightblue;
    z-index: 1;
    padding: 25px 10px;
    width: 30%;
    min-width: 200px;
    display: inline-block;
    cursor: pointer;
  }
  
  .two {
    background-color: yellow;
    z-index: -1;
    display: none;
  }
  
  .active {
    background: 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;div class="whatever-you-wanna-name top-product-list-ebbok"&gt;
    &lt;div class="frame"&gt;
      &lt;div class="c-3 one" data-id="p1"&gt;ebook image 1&lt;/div&gt;
      &lt;div class="c-3 one" data-id="p2"&gt;ebook image 2&lt;/div&gt;
      &lt;div class="c-3 one" data-id="p3"&gt;ebook image 3&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="whatever-you-wanna-name top-product-list-description"&gt;
    &lt;div class="frame"&gt;
      &lt;div class="two" id="p1"&gt;ebook for content image 1&lt;/div&gt;
      &lt;div class="two" id="p2"&gt;ebook for content image 2&lt;/div&gt;
      &lt;div class="two" id="p3"&gt;ebook for content image 3&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>