w3schools
  
HOME HTML CSS XML JAVASCRIPT ASP PHP SQL MORE...   References Examples Forum About

Password maxLength Property


Password Object Reference Password Object

Definition and Usage

The maxLength property sets or returns the maximum number of characters allowed in a password field.

Syntax

passwordObject.maxLength=number_of_chars


Example

Example

The following example alerts the maximum number of characters allowed in the specified password field:

<html>
<head>
<script type="text/javascript">
function alertLength()
  {
  alert(document.getElementById("password1").maxLength)
  }
</script>
</head>
<body>

<form>
<input type="password" id="password1" maxLength="8" />
<input type="button" id="button1" onclick="alertLength()"
value="Alert maxLength" />
</form>

</body>
</html>

Try it yourself »


Password Object Reference Password Object

DreamTemplate

WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Top 10 Web Hosting
UK Reseller Hosting
Web Hosting
FREE Web Hosting
Top Web Hosting
Cheap UK Web Hosting
WEB BUILDING
XML Editor – Free Trial!
FREE Flash Website
FREE Web Templates
SEO Company
EDUCATION
US Web Design Schools
HTML Certification
JavaScript Certification
XML Certification
PHP Certification
ASP Certification
STATISTICS
Browser Statistics
Browser OS
Browser Display
FLIGHT TICKETS
Find the cheapest flight
to any destination now!
SHARE THIS PAGE