代码示例:(标识:hdom_anchor_target)
<!DOCTYPE html>
<html>
<body>

<p><a id="w3s" target="_self" href="https://www.sou-xun.com/">(www.sou-xun.com)</a></p>

<p>单击按钮以显示上面链接的 target 属性的值。</p>

<button onclick="myFunction()">试一试</button>

<p id="demo"></p>

<script>
function myFunction() {
  var x = document.getElementById("w3s").target;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>
运行结果: