value 属性可设置或返回单选按钮的 value 属性的值。
radioObject.value=sometext
<html>
<head>
<script type="text/javascript">
function check(browser)
{
document.getElementById("answer").value=browser
}
</script>
</head>
<body>
<p>What's your favorite browser:</p>
<form>
<input type="radio" name="browser" onclick="check(this.value)"
value="Internet Explorer" />Internet Explorer<br />
<input type="radio" name="browser" onclick="check(this.value)"
value="Firefox" />Firefox<br />
<input type="radio" name="browser" onclick="check(this.value)"
value="Netscape" />Netscape<br />
<input type="radio" name="browser" onclick="check(this.value)"
value="Opera" />Opera<br />
<br />
Your favorite browser is: <input type="text" id="answer" size="20" />
</form>
</body>
</html>
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛
Powered by 365建站网 RSS地图 HTML地图
copyright © 2013-2024 版权所有 鄂ICP备17013400号