title: Change Class of a specific div onClick, among many div's with same class
body: <p>I want to change the class of only the div whose button is clicked. I tried something like this but it is not available </p>
  
  <pre><code>$(".a",this).toggleClass( "b" ); //
  </code></pre>
  
  <p>What would be an alternate way to do this?</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>$(".button").click(function() {
    $(".a").toggleClass("b");
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.a {
    height: 200px;
    width: 200px;
    float: left;
    background: red;
    margin-left: 10px;
  }
  .b {
    height: 200px;
    width: 300px;
    float: left;
    background: blue;
    margin-left: 10px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="a"&gt;
    &lt;button class="button"&gt;clickme&lt;/button&gt;
  &lt;/div&gt;
  &lt;div class="a"&gt;
    &lt;button class="button"&gt;clickme&lt;/button&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>