当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM id属性
The id property sets or returns the id of a link
id属性可设置或返回链接的id
anchorObject.id=id |
The following example outputs the id of a link:
下面的举例将输出链接的id:
<html> <body> <p><a id="myAnchor" href="http://www.w3schools.com">Visit W3Schools.com</a></p> <script type="text/javascript"> x=document.getElementById("myAnchor"); document.write(x.id); </script> </body> </html> |
Get the id of a link
得到连接的id