title: Get checkbox status using javascript
body: <p>This is my checkbox HTML code</p>
  
  <pre><code>&lt;input id="termsCheckbox" name="termsCheckbox" type="checkbox" value="terms" &lt;?PHP echo $terms; ?&gt; class="checkbox"&gt;
  </code></pre>
  
  <p>this is javascript code</p>
  
  <pre><code>var terms = $("#termsCheckbox");
  
  function validateTerms(){
  if(termsCheckbox.checked == false){
  terms_div.addClass("terms_error");
  return false;
  }
  else{           
  terms_div.removeClass("terms_error");
  return true;
  }
  }
  </code></pre>
  
  <p>I want to check whether checkbox checked or not and if not add a class to terms_div. Please help me to solve this problem. thanks</p>