当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM target属性

HTML DOM
DOM TableRow 对象
DOM Textarea 对象
DOM Window 对象

HTML DOM target属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 499 ::
收藏到网摘: n/a

Definition and Usage
定义与用法

The target property sets or returns where to open the link-URL in an area.
target属性可设置或返回area中连接的打开方式

Syntax
语法

areaObject.target=_blank|_parent|_self|_top
  • _blank - the target URL will open in a new window (新窗口中打开)
  • _self - the target URL will open in the same frame as it was clicked(当前窗口或框架打开连接)
  • _parent - the target URL will open in the parent frameset (在父级框架集中打开连接)
  • _top - the target URL will open in the full body of the window (窗口的主体中打开,脱离框架)

Example
举例

The following example changes the target of the link in the image-map:
下面的举例将改变热点图片中连接的打开方式:

<html>
<head>
<script type="text/javascript">
function changeTarget() { document.getElementById('venus').target="_blank" }
</script>
</head>
<body>
<img src ="planets.gif"
width="145" height="126"
alt="Planets"
usemap ="#planetmap" />
<map name ="planetmap">
<area shape ="circle" coords ="124,58,8"
href ="venus.htm" id="venus" />
</map>
<br />
<input type="button" onclick="changeTarget()"
value="Change target" />
</body>
</html>


演练

Change the target of a link in an image-map
改变热点地图的连接target

评论 (0) All

登陆 | 还没注册?