简单教程
提交运行
代码编辑器:
<script> function changeLink(){ document.getElementById('myAnchor').innerHTML="TWLE"; document.getElementById('myAnchor').href="//www.twle.cn"; document.getElementById('myAnchor').target="_blank"; } </script> <a id="myAnchor" href="//www.microsoft.com">Microsoft</a> <input type="button" onclick="changeLink()" value="修改链接">
运行结果: