HTML DOM target 屬性
定義和用法
target 屬性可設(shè)置或返回頁面中所有鏈接的默認(rèn) target。
語法
baseObject.target=target
實(shí)例
下面的例子可返回默認(rèn)的鏈接 target:
<html>
<head>
<base id="myBaseId" target="_blank"
href="http://www.dbjr.com.cn/htmldom/" />
</head>
<body>
<p>Base target:
<script type="text/javascript">
x=document.getElementById('myBaseId');
document.write(x.target
);
</script>
</body>
</html>
輸出:
Base target: _blank