运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <p><a id="myAnchor" target="_blank" href="http://www.example.com:443/test.htm#part2">Example link</a></p> <p>Click the button to change the hostname of the link above.</p> <p><b>Tip:</b> Open the link and look in the address bar before and after you have clicked the "Try it" button (Note: these links does not exist, this is just an example).</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myAnchor").host = "www.somenewexamplepage.com"; document.getElementById("demo").innerHTML = "The hostname of the Example link was changed."; } </script> </body> </html>