Showing posts with label jQuery. Show all posts
Showing posts with label jQuery. Show all posts

Wednesday, January 27, 2010

Handing Checkboxes with jQuery

To determine whether a specific checkbox has been checked:

if ($('#edit-checkbox-id:checked').val() !== null) { // Insert code here. }

Another variation:

var checked =
$('#edit-checkbox-id:checked').val() == 'on';

Courtesy of: http://drupal.org/node/116548