This is my checkbox HTML code
<input id="termsCheckbox" name="termsCheckbox" type="checkbox" value="terms" <?PHP echo $terms; ?> class="checkbox">
this is javascript 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;
}
}
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