jquery - How to check specific checkbox is checked or not -
i have below code need check if first 2 checkbox checked or not.
i need check against id's.
like how check if first 2 checkbox checked or not.
<input type="checkbox" name="check1" id="check1id" tabindex="1" value="test" /> <input type="checkbox" name="check2" id="check2id" tabindex="2" value="test" /> <input type="checkbox" name="check3" id="check3id" tabindex="3" value="test" /> var boxes = $('.checkbox input'); if(boxes.length > 0) { if( $(':checkbox:checked').length < 1) { if($("#error-select").length == 0){ $("#error-checkbox").show(); } return false; } else{ $("#error-checkbox").hide(); }
how this.
regards
to find if check box checked can jquery is() selector
if($("#check1id").is(':checked') || $("#check2id").is(':checked')) { alert("you have checked checkbox check1id") }
Comments
Post a Comment