编辑下面的代码:【加编码】
<html> <head> <script> function changeTarget() { document.getElementById('w3s').target="_blank"; } </script> </head> <body> <a id="w3s" href="/">Visit ZiQiangXueTang</a> <br><br> <input type="button" onclick="changeTarget()" value="Change target"> <p>Try the link before and after you have pressed the button!</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂