Password.onFocus

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

onFocus="command"

Description

The onFocus event handler of the Password object is used to handle the Focus event for the password box.

Example

Listing 7.421 shows an example of the onFocus event handler.

Listing 7.421 Example of the onFocus Event Handler
<html>
<head>
<title> Example of the password onFocus event handler</title>
</head>
<body>

<script language="JavaScript">
<!--Hide
// sets a message in the text box
function set(){
     document.form1.pass.value="aha123";
}
// End Hide --->
</script>
							

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