JavaScript Reference/Javascript Properties/maxLength — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 08:21, 26 мая 2010
"maxLength" Example
<html>
<body>
<input type="password" id="myText">
<script language="JavaScript">
document.getElementById("myText").maxLength = 10;
</script>
</body>
</html>
"maxLength" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |<input type="password"> <input type="text"> |
+----------------+--------------------------------------------------------------+
"maxLength" Syntax and Note
Note:
Read and write property.
Sets the maximum number of characters that can fit into the text field.
Syntax:
document.getElementById("inputID").maxLength = value
document.all.inputID.maxLength = value // IE only