I've successfully pulled the checked value from a radio button group with jQuery 1.4 using the following code:
var myFirstVar = $("input[name='myFirstVar']:checked").val();
How would I alter this code to find out whether a check-box was checked, and to change the value of the var based on whether it is checked or not.
I tried many things, but here is an example of what I thought would work:
if ($("input[name='mySecondVar']:checked")) {
var mySecondVar = "Yes";
}
else {
var mySecondVar = "No";
}
Any insight on simply changing the value whether the box is checked or not would be great.