Password.type

JavaScript 1.1+, JScript 1.0+ Nav3+, IE 3+, Opera3+ Syntax

							password.type

Description

The type property of the Password object is used to get the HTML TYPE attribute associated with the password box. For the Password object, this value is always password.

Example

Listing 7.423 shows an example of how the type property is used. When the button is clicked, an alert box is displayed showing the value of the type property.

Listing 7.423 Example of the type Property
<html>
<head>
<title> Example of the password type property</title>
</head>
<body>

<form name="form1">
<input type="PASSWORD" Name="pass" size=10>
<br>
<input type="BUTTON" value="Get Type" onClick=alert(document.form1.pass.type)>
</form>

</body>
							
</html>
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.