Latest web development tutorials

HTML DOM Area target property

Area Object Reference Area objects

Definition and Usage

target property sets or returns the property value of the target area.

grammar

areaObject.target=value

target attribute can have the following values:

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


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support target attribute


Examples

Examples

The following example returns the target attribute of the image map "Venus" area:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<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>"金星"区域taget属性的值是:
<script>
document.write(document.getElementById("venus").target);
</script>
</p>

</body>
</html>

Examples of the above output:

"金星"区域taget属性的值是: _blank

try it"


Area Object Reference Area objects