title: Combining two jQuery statements using this and not
body: <p>I am currently having to use two statements for this and I'd like to combine this into one statement if possible.</p>
  
  <p>The hierarchy for the CSS is -</p>
  
  <pre><code>div#optionsbox1
      div.checkbox
        a.help
      div.checkbox
        a.help
  </code></pre>
  
  <p>I'd like to .addClass('readOnly') to the div.checkbox where a.help was not clicked. So if I clicked a.help in the first div.checkbox I'd like for the second div.checkbox to have the .addClass('readOnly') applied and vice versa.</p>
  
  <p>Here's the current syntax that I'm using right now to accomplish this.</p>
  
  <pre><code>$("#optionsbox1 .checkbox").addClass('readOnly');
  $(this).parent(".checkbox").removeClass('readOnly');
  </code></pre>
  
  <p>Here's the entire function -</p>
  
  <pre><code>$(this).click(function()
  {
      if($(this).attr('checked')){
          if($(this).hasClass('readOnly')){
              $(this).removeClass('readOnly');
          }
          $("#optionsbox1 :checkbox").not(this).prop('checked',false);
          $("#optionsbox1 .checkbox").addClass('readOnly');
          $(this).parent(".checkbox").removeClass('readOnly');
          $(this).prop('checked',true);
      } else {
          $(this).prop('checked',false);
          $("#optionsbox1 :checkbox").removeClass('readOnly');
      }
  });
  </code></pre>