Set the checkbox to checked or not checked

Set the checkbox to checked or not checked

Postby tomrff » Thu Apr 28, 2011 1:53 pm

Set the checkbox to checked or not checked
The status of the checkbox can be changed using the attr() function like so, to check the box:

$('input[name=foo]').attr('checked', true);
and like so to uncheck the box:

$('input[name=foo]').attr('checked', false);
tomrff
 
Posts: 33
Joined: Sat Jan 08, 2011 10:12 pm

Return to JQuery

Who is online

Users browsing this forum: No registered users and 1 guest

cron