js获得单选按钮显示的文本值
<body>
<input type= "radio" name= "radio1" value= "1" onclick= "showText(this)"/> 一号
<input type= "radio" name= "radio1" value= "2" onclick= "showText(this)" /> 二号
<input type= "radio" name= "radio1" value= "3" onclick= "showText(this)"/> 三号
</body>
<script>
function showText(obj)
{
var textnode = obj.nextSibling; //设置父节点
alert(textnode.nodeValue);
}
</script>
by波神。

浙公网安备 33010602011771号