x
1
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<title>蜜蜂教程(mifengjc.com)</title>
6
<script>
7
function changeTarget() {
8
document.getElementById('w3s').target = "_blank";
9
}
10
</script>
11
</head>
12
13
<body>
14
<a id="w3s" href="https://www.mifengjc.com">访问 Mifengjc</a>
15
<br><br>
16
<input type="button" onclick="changeTarget()" value="修改target">
17
<p>尝试在你单击按钮之前点击链接。</p>
18
19
</body>
20
</html>