运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往空间
<!DOCTYPE html> <html> <body> <p><a id="myAnchor" href="https://w3schools.org.cn">W3Schools</a></p> <p>Click the button to set the value of the type attribute of the link above to "text/html".</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myAnchor").type = "text/html"; document.getElementById("demo").innerHTML = "The value of the type attribute of the link above is now 'text/html'."; } </script> </body> </html>