Skip to content

Instantly share code, notes, and snippets.

@rasec
Created March 27, 2012 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rasec/2216155 to your computer and use it in GitHub Desktop.
Save rasec/2216155 to your computer and use it in GitHub Desktop.
radio buttons value
var getRadioValue = function(radioName){
var radios = document.getElementsByName(radioName);
for( i = 0; i < radios.length; i++ ) {
if( radios[i].checked ) {
return radios[i].value;
}
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment