Check if the checkbox is checked

Check if the checkbox is checked

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

Check if the checkbox is checked
There are several ways to get to work out if a checkbox is checked or not with jQuery, and here a couple of alternatives. Each will return true if it's checked or false if it's not.

$('input[name=foo]').is(':checked')
$('input[name=foo]').attr('checked')
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 2 guests

cron