HTML DOM size Property
Complete Text Object Reference
Definition and Usage
The size property sets or returns the size of a text field (in number of
characters).
Syntax
textObject.size=number_of_char
|
Example
The following example alerts the size of the text field:
<html>
<head>
<script type="text/javascript">
function fieldSize()
{
alert(document.getElementById("name").size)
}
</script>
</head>
<body>
<form>
Name: <input type="text" id="name" value="Mickey Mouse" size="20"
maxlength="30" />
<br /><br />
<input type="button" onclick="fieldSize()" value="Alert size" />
</form>
</body>
</html>
|
Try-It-Yourself Demos
Alert size
and maximum length of a text field
Complete Text Object Reference
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|