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

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

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

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

HTML DOM href ÊôÐÔ


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

¶¨ÒåÓëÓ÷¨

The href property sets or returns the URL of the linked resource.
href ÊôÐÔ¿ÉÓÃÀ´ÉèÖûò·µ»ØÁ¬½ÓµÄURL×ÊÔ´

Óï·¨

anchorObject.href=URL


¾ÙÀý

<html>

<head>
<script type="text/javascript">
function changeLink()
{
document.getElementById('myLink').innerHTML="W3pop"
document.getElementById('myLink').href="http://www.w3pop.com"
document.getElementById('myAnchor').target="_blank"
}
</script>

</head>
<body>
<a id="myLink" href="http://www.microsoft.com">Microsoft</a>
<br /><br />
<input type="button" onclick="changeLink()" value="Change link">

</body>
</html>


³¢ÊÔÓëÑÝʾ

Change text, URL, and target attribute of a link
¸Ä±äÁ¬½ÓµÄÎÄ×Ö£¬URLºÍÄ¿±êÊôÐÔ

ÆÀÂÛ (1) 1 All