HTML DOM Area password Property
THE WORLD'S LARGEST WEB DEVELOPER SITE

Area password Property

❮ Area Object

Example

Return the password part of the URL for a specific area in an image-map:

var x = document.getElementById("venus").password;
Try it Yourself »

Definition and Usage

The password property sets or returns the password part of the href attribute value.

The href attribute specifies the destination of a link in an area.

In a URL, the password part is the password entered by the user. It is specified after the username and before the hostname.

Example: https://johnsmith:smith123@www.example.com (johnsmith is the username and smith123 is the password).

Tip: Use the username property to set or return the username part of the href attribute value.


Browser Support

Property
password Yes Not supported Yes Not supported Yes

Syntax

Return the password property:

areaObject.password

Set the password property:

areaObject.password = password

Property Values

Value Description
password Specifies the password part of a URL

Technical Details

Return Value: A String, representing the password part of the URL

More Examples

Example

Change the password part of a specific area in an image-map:

document.getElementById("venus").password = "newPassword101";
Try it Yourself »

❮ Area Object