I want the same thing to happen for each of a series of radio buttons when they are checked. So far I have the following working code:
if ($("input[type=radio]:checked#rd1").length > 0) {
// do something
} else if ($("input[type=radio]:checked#rd2").length > 0) {
// do something
} else if ($("input[type=radio]:checked#rd3").length > 0) {
// do something
}
I tried to do the following:
if ($("input[type=radio]:checked#rd1"||"input[type=radio]:checked#rd2").length > 0) {...}
and I got a warning to say it was 'heuristically unreachable'.
Anyway of making this more compact?
EDIT: If #rd1 / #rd2 / #rd3 are checked they all do the exact same thing. // do something in this case means the same outcome for each radio button. So I wanted to make the if statement more concise as it results in the same outcome for each 'checked'.