<input type="radio" id="radio1" name="rb1" value="no"> No
<input type="radio" id="radio2" name="rb1" value="yes"> Yes
when I say this alert("Test =="+$('#radio1').attr('checked'));
I expect false
because it's not checked but it returns undefined
.
What is the correct statement?
Why am I getting undefined
?