I assume that getElementById does not work with radio buttons if you want to get its value or find out if it is checked? I say this because I did this:
<input id="radio1" type="radio" name="group1" value="h264" checked="checked" />
<input id="radio2" type="radio" name="group1" value="flv" />
To get the value of the selected, I did the following:
function getRadioValue() {
if(document.getElementById('radio1').value=='h264'){
return 'h264';
}
else{
return 'flv';
}
}
However, firebug continues to tell me:
document.getElementById("radio1") is null
[Break on this error] if(document.getElementById('radio1').checked==true){
What am I doing wrong?
Thank you all
source
share