目录

HTML DOM area 对象


区域对象

Area 对象表示 HTML <area> 元素。

访问区域对象

您可以使用 getElementById() 访问 <area> 元素:

示例

var x = document.getElementById("myArea");
亲自试一试 »

创建区域对象

您可以使用 document.createElement() 方法创建 <area> 元素:

示例

var x = document.createElement("AREA");
亲自试一试 »

区域对象属性

Property Description
alt Sets or returns the value of the alt attribute of an area
coords Sets or returns the value of the coords attribute of an area
hash Sets or returns the anchor part of the href attribute value
host Sets or returns the hostname and port part of the href attribute value
hostname Sets or returns the hostname part of the href attribute value
href Sets or returns the value of the href attribute of an area
noHref Not supported in HTML5.
Sets or returns the value of the nohref attribute of an area
origin Returns the protocol, hostname and port part of the href attribute value
password Sets or returns the password part of the href attribute value
pathname Sets or returns the pathname part of the href attribute value
port Sets or returns the port part of the href attribute value
protocol Sets or returns the protocol part of the href attribute value
search Sets or returns the querystring part of the href attribute value
shape Sets or returns the value of the shape attribute of an area
target Sets or returns the value of the target attribute of an area
username Sets or returns the username part of the href attribute value

标准属性和事件

Area 对象还支持标准特性事件


相关页面

HTML 参考:HTML <区域> 标签