ÍøÂçѧԺ w3popÉçÇø ÍøÂç×ÊÔ´ ITÐÂÎÅ

w3pop.com :: ÍøÂçѧԺ :: HTML DOM :: HTML DOM idÊôÐÔ

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

Íü¼ÇÃÜÂë? ×¢²á

HTML DOM idÊôÐÔ


×÷Õß:w3pop.com ·­Òë/ÕûÀí:w3pop.com ·¢²¼:2007-04-28 ä¯ÀÀ:1539 :: ::

Definition and Usage
¶¨ÒåÓëÓ÷¨

The id property sets or returns the id of a link
idÊôÐÔ¿ÉÉèÖûò·µ»ØÁ´½ÓµÄid

Syntax
Óï·¨

anchorObject.id=id


Example
¾ÙÀý

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