Password.focus()

JavaScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax

							password.focus()

Description

The focus() method of the Password object sets the focus to the password box.

Example

Listing 7.416 shows an example of how the focus() method is used to move the focus back to the password box.

Listing 7.416 Example of the focus() Method
<html>
<head>
<title> Example of the password focus method</title>
</head>
<body>

<form name="form1">
<input type="PASSWORD" Name="pass" size=10>
<br>
<input type="BUTTON" value="Show Password" onClick=document.form1.pass.focus()>
</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.