HTML DOM target 属性
定义和用法
target 属性可设置或返回页面中所有链接的默认 target。
语法
- baseObject.target=target
实例
下面的例子可返回默认的链接 target:
- <html>
- <head>
- <base id="myBaseId" target="_blank"
- href="http://www.yousite.com/htmldom/" />
- </head>
- <body>
- <p>Base target:
- <script type="text/javascript">
- x=document.getElementById('myBaseId');
- document.write(
x.target
);- </script>
- </body>
- </html>
输出:
- Base target: _blank