HTML DOM hash ÊôÐÔ

¶¨ÒåºÍÓ÷¨

hash ÊôÐÔ¿ÉÉèÖûò·µ»ØÒ»¸öÇøÓòÖÐ URL µÄ겿·Ö¡£

Óï·¨

areaObject.hash=anchorname

ʵÀý

ÏÂÃæµÄÀý×Ó¿É°Ñ URL µÄ겿·Ö #top ¸ü¸ÄΪ #bottom£º

<html>
<head>
<script type="text/javascript">
function changeLink()
  {
  document.getElementById('venus').hash="bottom"
  }
</script>
</head>
<body>

<img src="planets.gif" 
width="145" height="126" 
usemap="#planetmap" />

<map name="planetmap">
<area id="venus" shape="circle" 
coords="124,58,8" 
alt="Venus"
href="venus2.htm#top" />
</map>

<input type="button" onclick="changeLink()" value="Change link" />

</body>
</html>
VUE