October 11, 2012

check or uncheck a html checkbox using jquery

How to check or uncheck a html checkbox using jquery.

How to select or choose a checkbox?

$('input:checkbox[value=Barcelona]').attr('checked',true);

The above code will check/choose/select a html checkbox whose value is hello, you can even choose name instead of value

$('input:checkbox[name=premierleague]').attr('checked',true);

to uncheck use the below code

$('input:checkbox[value=realMandrid]').attr('checked',false);

This is a small example for AJAX jquery checkbox example, please try it ....

http://belazy.blog.com/  +joseph james 

No comments:

Post a Comment

Your feedback may help others !!!

Facebook comments