JavaScript Password Object

The JavaScript Password object is a property of the form object. Password FORM syntax is:


An password example:

<INPUT TYPE="password" NAME="thisPwd" SIZE=10 MAXLENGTH=15 VALUE="">

How it looks:

The password element may be accessed using one of the following methods:



  • defaultValue - The default value of the password object.
  • form- The form object that includes the password object.
  • name - The name of the password object.
  • type - The type of element which is password.
  • value - The value of the password object.


  • blur() - Takes the focus away from the password object.
  • focus() - Gives the focus to the password object.
  • select() - The contents of the password object are selected.


  • onBlur
  • onFocus