I have two radio buttons in my form. Now what I found out is that in firefox, if you refresh the form, is a radio button was selected before the refresh, then after the refresh the radio button is still selected. I want to know is there a way by using javascript code to be able to say no radio buttons should be already selected when page reloads or refreshes or does it all depend on browser?
I tried including in the window.onload=function()
btnRadioO[0].checked==false && btnRadioO[1].checked==false
which I thought would do the trick but it didn’t work. Any ideas?
Below is code for radio buttons in javascript:
window.onload=function(){
var btnRadioO = document.getElementsByName("weightChoice");
btnRadioO[0].checked==false && btnRadioO[1].checked==false;
}
Html code:
<table>
<tr>
<th>6: Provide a Total Weight for your Yourself</th>
<td><input type="radio" name="weightChoice" value="yes" onClick="getWeight()"/> Yes</td>
<td><input type="radio" name="weightChoice" value="No" onClick="getWeight()"/> No</td>
</tr>
</table>