Base target 属性
 Base 对象
 Base 对象
定义和用法
target 属性可设置或返回基础元素中 target 属性的值。
target 属性指定了页面中在何处打开所有链接。
语法
baseObject.target=value
target 属性可以是以下的一个值:
| 值 | 描述 | 
|---|---|
| _blank | 在新窗口打开链接 | 
| _self | 在同一个框架(默认)中打开链接。 | 
| _parent | 在父框架中打开链接 | 
| _top | 在窗口文档中打开链接。 | 
| framename | 在一个指定的框架中打开链接 | 
浏览器支持





所有主要浏览器都支持 target 属性
实例
返回页面中所有链接的基础链接的 target 属性:
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>蜜蜂教程(mifengjc.com)</title>
  <base id="htmldom" target="_blank" href="https://www.mifengjc.com/js-ref/">
</head>
<body>
  <p>所有链接的基链接:
    <script>
      document.write(document.getElementById("htmldom").target);
    </script>
  </p>
</body>
</html>
 Base 对象
 Base 对象