javascript RadioButtonList获取选中值
发布时间:2016-12-30 来源:查字典编辑
摘要:functionGetRblSeletedValue(obj){varrbltable=$(obj);varrbs=rbltable.get...
<script>
function GetRblSeletedValue(obj)
{
var rbltable =$(obj);
var rbs= rbltable.getElementsByTagName("INPUT");
for(var i = 0;i<rbs.length;i++)
{
if(rbs[i].checked)
{
var text =rbltable.cells[i].innerText;
var value=rbs[i].value;
alert("选中项的text值为"+text+",value值为"+value);
}
}
}
function $(id)
{
return document.getElementById(id);
}
</script>