title: Jquery removeclass with buttons
body: <p>How can I target a subset of all buttons with a specific class? What i'm trying to accomplish is, that only one button with P or S can be selected at a time. If a user clicks on a specific "P" button it removes the highlight class from every other "P" button, same with "S". </p>
  
  <p><a href="http://jsbin.com/adopuz/1/edit" rel="nofollow">http://jsbin.com/adopuz/1/edit</a></p>
  
  <pre><code>$(':button').on('click', function() {
  
        var typeid = $(this).attr('value');
        $(this).addClass('highlight');
  
        if(typeid == 'P') {
          $('.primary').val(0);
  
          $(':button').removeClass('highlight');
  
          var opts = $(this).parent().find('input').eq(0).val(1);
  
  
        }
  
        if(typeid == 'S') {
  
        $('.static').val(0);
        var optp = $(this).parent().find('input').eq(1).val(1);
  
        }
  
      });
  </code></pre>
  
  <h2>HTML</h2>
  
  <pre><code>  &lt;div id= "US"&gt;
      This is the US
    &lt;div id="Monday"&gt;
  
  &lt;input name='' value='1' class="primary" type=''&gt;
  &lt;input name='' value='0' class="static" type=''&gt;
  
  
  &lt;input type='button' value='P' class='P'&gt;
  &lt;input type='button' value='S' class='S'&gt;
  
    &lt;/div&gt;
  
      &lt;div id="Tuesday"&gt;
  
  &lt;input name='' value='1' class="primary" type=''&gt;
  &lt;input name='' value='0' class="static" type=''&gt;
  
  &lt;input type='button' value='P' class=''&gt;
  &lt;input type='button' value='S' class=''&gt;
  
  
    &lt;/div&gt;
  
        &lt;div id="Wednesday"&gt;
  
  &lt;input name='' value='1' class="primary" type=''&gt;
  &lt;input name='' value='0' class="static" type=''&gt;
  
  
  &lt;input type='button' value='P' class=''&gt;
  &lt;input type='button' value='S' class=''&gt;
  
    &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>