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

HTML DOM Password value Property

Password value Property

Password Object Reference Password Object


Definition and Usage

The value property sets or returns the value of the value attribute of the password field.

For security reasons, some browsers may prevent JavaScript code from reading the value property.

Syntax

Set the value attribute:

passwordObject.value="

value

"

Return the value attribute:

passwordObject.value


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the value property.


Example

Example

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

Runoob Tutorial(runoob.com)

Password:

Try it »


Password Object Reference Password Object