I have this HTML:
<input type="radio" name="test" id="test" value="1"><br>
<input type="radio" name="test" id="test" value="2"><br>
<input type="radio" name="test" id="test" value="3"><br>
<input type="button" onclick="CreateJobDo">
When the page loads, none of them will be checked. I want to use jQuery to check if one of the radio buttons is checked when the button is pressed.
I have this:
function CreateJobDo(){
if ($("input[@name=test]:checked").val() == 'undefined') {
// go on with script
} else {
// NOTHING IS CHECKED
}
}
But this does not work. How to get it working?