Friday, September 5, 2014

How to Check Uncheck checkbox using Jquery

1 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");

1 comment:

  1. Thank you so much for shared this posting . Like your post .

    ReplyDelete