Area password attribute

Definition and usage

password Attribute set or return href attribute value password part.

href The attribute specifies the destination of the link in the specified area.

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

For example: https://billgates:bill234@www.example.com (billgates is the username, bill234 is the password).

Tip:Please use username attribute Set or return href attribute value user name part.

Example

Example 1

Return the password part of the URL of the specific area in the image map:

var x = document.getElementById("venus").password;

Try it yourself

Example 2

Change the password part of the specific area in the image map:

document.getElementById("venus").password = "newPassword101";

Try it yourself

Syntax

Return password attribute:

areaObject.password

Set password attribute:

areaObject.password = password

属性值

描述
password 规定 URL 的密码部分。

技术细节

返回值: 字符串值,表示 URL 的密码部分。

浏览器支持

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
支持 不支持 支持 不支持 支持