/ Published in: JavaScript
Expand |
Embed | Plain Text
var var_name = $('#checkbox_id').attr('checked')?1:0;
Comments
Subscribe to comments
You need to login to post a comment.
penguin999 on 07/24/07
7 people have marked this snippet as a favorite
francisre
heinz1959
AgentPhoenix
yetanother
martingoldszein
maxvee8
seanpowell
var var_name = $('#checkbox_id').attr('checked')?1:0;
Subscribe to comments
You need to login to post a comment.
Nice tip. Also you can use .is(':checked') jQuery method wich is among other methods is explained in this jQuery checkbox article