HTML DOM value Property
Complete Text Object Reference
Definition and Usage
The value property sets or returns the value of a
text field.
Syntax
Example
The following example gets the value of the text field:
<html>
<head>
<script type="text/javascript">
function alertValue()
{
alert(document.getElementById("text1").value)
}
</script>
</head>
<body>
<form>
<input type="text" id="text1" value="Hello world!" />
<input type="button" id="button1" onclick="alertValue()"
value="Show default value" />
</form>
</body>
</html>
|
Try-It-Yourself Demos
Alert the
value of a text field
Form validation
Radio buttons in a form
Checkboxes in a form
Dropdown list in a form
Another dropdown list
Complete Text Object Reference
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|