Area target 属性

Area 对象参考手册 Area 对象

定义和用法

target 属性可设置或者返回区域中 target 属性值。

语法

areaObject.target=value

target 属性可以是以下值:

描述
_blank 在一个新的未命名的窗口载入文档
_self 在相同的框架或窗口中载入目标文档
_parent 把文档载入父窗口或包含了超链接引用的框架的框架集
_top 把文档载入包含该超链接的窗口,取代任何当前正在窗口中显示的框架
framename 在同一个名称的frame框架中载入文档。


浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要浏览器都支持 target 属性


实例

实例

下面的例子可返回图像映射中 "Venus" 区域的 target 属性:

<html>
<body>

<img src="planets.gif"
width="145" height="126"
usemap="#planetmap">

<map name="planetmap">
<area id="venus" shape="circle"
coords="124,58,8"
alt="Venus"
href="venus.htm"
target="_blank">
</map>

<p>The value of the target attribute for the "Venus" area is:
<script>
document.write(document.getElementById("venus").target);
</script>
</p>

</body>
</html>

以上实例输出结果:

The value of the target attribute for the "Venus" area is: _blank

尝试一下 »


Area 对象参考手册 Area 对象