Friday, September 5, 2014

How to Check Uncheck checkbox using Jquery

Leave a Comment
There are different ways of selecting(check) or unselecting(uncheck) check box using jquery. Let us look at different way of checking and unchecking checkbox in jquery:

Select Check box using Id attribute of checkbox:

$('#checkboxid').attr("checked","checked");

OR

$('#checkboxid').attr("checked",true);


Check checkbox using class attribute:

$('.checkboxclassname').attr("checked","checked");

OR

$('.checkboxclassname').attr("checked",true);

Uncheck checkbox  using Jquery:

Uncheck checkbox using Id attribute:

$('#checkboxid').removeAttr("checked");

Uncheck checkbox using class attribute:

$('.checkboxclassname').removeAttr("checked");

0 comments:

Post a Comment