HTML DOM value ÊôÐÔ

¶¨ÒåºÍÓ÷¨

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>
VUE