最新的Web開發教程
 

Area username Property

<區域對象

返回的URL在圖像映射中的特定區域的用戶名部分:

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

x的結果將是:

johnsmith
試一試»

定義和用法

用戶名屬性設置或返回的用戶名部分href屬性值。

href屬性指定的區域中的鏈接的目標。

在URL,用戶名部分是由用戶輸入的用戶名。 據該協議後,密碼部分之前指定。

實施例: 20(JohnSmith對%圖20是%第二十條%20username%20於是%20smith123%圖20是%第二十條%20passwordis%第二十條%20password / index.html中“> HTTPS:// JohnSmith對[email protected] (johnsmith is the username and smith123 is the password )。

提示:使用密碼屬性來設置或返回的密碼部分href屬性值。


瀏覽器支持

屬性
username 不支持 不支持

句法

返回用戶名屬性:

areaObject .username

設置用戶名屬性:

areaObject .username= 屬性值
描述
username 指定URL的用戶名部分

技術細節

返回值: 一個String,表示URL的用戶名部分

更多示例

更改圖像映射的特定區域的用戶名部分:

document.getElementById("venus").username = "newUsername";
試一試»

區域對象參考 Area對象