Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Password defaultValue Property

Password defaultValue Property

Password Object Reference Password Object


Definition and Usage

The defaultValue property sets or returns the default value of the password field.

Note: This default value is the value specified in the HTML "value" attribute.

Syntax

Set the defaultValue property:

passwordObject.defaultValue="

value

"

Return the defaultValue property:

passwordObject.defaultValue


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the defaultValue property


Example

Example

The following example gets the default value of the password field:

Password:

Try it »


Password Object Reference Password Object