w3pop.com :: ÍøÂçѧԺ :: 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
ÆÀÂÛ (0)
All