js获取radio的值

function getRadioValue(objName) 
{
var objs = document.getElementsByName(objName);
for(var i=0; i<objs.length; i++)
{
if(objs[i].tagName.toLowerCase()=='input' && objs[i].checked) return objs[i].value;
}
return null;
}
posted @ 2012-02-16 21:28  haiwei.sun  阅读(296)  评论(0编辑  收藏  举报
返回顶部