HTML DOM value Property
Complete Radio Object Reference
Definition and Usage
The value property sets or returns the value of the value attribute of the
radio button.
Syntax
radioObject.value=sometext
|
Example
<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>
|
Try-It-Yourself Demos
Use the
value attribute in radio buttons
Complete Radio Object Reference
Learn XML with <oXygen/> XML Editor - Free Trial!
|
|
oXygen helps you learn to define,
edit, validate and transform XML documents. Supported technologies include XML Schema,
DTD, Relax NG, XSLT, XPath, XQuery, CSS.
Understand in no time how XSLT and XQuery work by using the intuitive oXygen debugger!
Do you have any XML related questions? Get free answers from the oXygen
XML forum
and from the video
demonstrations.
Download a FREE 30-day trial today!
|
|