Created
October 21, 2016 13:39
-
-
Save bestony/8c6a28e7e3e84bd2e9da79cd128ae295 to your computer and use it in GitHub Desktop.
获取Radio的值
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getRadioValue(RadioName){ | |
var obj; | |
obj=document.getElementsByName(RadioName); | |
if(obj!=null){ | |
var i; | |
for(i=0;i<obj.length;i++){ | |
if(obj[i].checked){ | |
return obj[i].value; | |
} | |
} | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment