178
rated 0 times
[
181]
[
3]
/ answers: 1 / hits: 16993
/ 12 Years ago, fri, april 20, 2012, 12:00:00
I want to check if a certain check box is selected using JavaScript/jQuery.
Here is the code I tried:
var a;
if ($(#add_desc).checked == 1){
a = true;
}else{
a= false;
}
I have also tried:
var a;
if ($(#add_desc).checked){
a= true;
}else{
a= false;
}
It always returns false once I alert the variable a
.
Any idea why it won't work for me? Am I doing it wrong?
Thanks!
More From » jquery