编辑下面的代码:【加编码】
<html> <head> <link id="link1" rel="stylesheet" type="text/css" href="/demo/style1.css"> <script> function displayResult() { var x=document.getElementById("link1").rel; alert(x); } </script> </head> <body> <button type="button" onclick="displayResult()">Display relationship of link element</button> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂