The purpose is to figure out which one of the radio buttons is checked. What is below in the IF statement works if there is no <label> used in the html part. In this case <label> is used so how should the IF statement be modified?
Code:
function set12h24() {
if (document.switch12h24_form.radio12h24.value == "24h")
{
do something here.
}
}
<div id="radio_side">
<form name="switch12h24_form">
<label class="h2412off"> <input type="radio" name="radio12h24" value="12h" class="h2412_button" ><a onclick="set12h24()">12h</a></label>
<label class="h2412off"> <input type="radio" name="radio12h24" value="24h" class="h2412_button" ><a onclick="set12h24()">24h</a></label>
</form>
</div>
Thanks!