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

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

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

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

HTML DOM targetÊôÐÔ


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

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

The target property sets or returns where to open the link-URL in an area.
targetÊôÐÔ¿ÉÉèÖûò·µ»ØareaÖÐÁ¬½ÓµÄ´ò¿ª·½Ê½

Syntax
Óï·¨

areaObject.target=_blank|_parent|_self|_top
  • _blank - the target URL will open in a new window £¨Ð´°¿ÚÖдò¿ª£©
  • _self - the target URL will open in the same frame as it was clicked£¨µ±Ç°´°¿Ú»ò¿ò¼Ü´ò¿ªÁ¬½Ó£©
  • _parent - the target URL will open in the parent frameset £¨ÔÚ¸¸¼¶¿ò¼Ü¼¯Öдò¿ªÁ¬½Ó£©
  • _top - the target URL will open in the full body of the window £¨´°¿ÚµÄÖ÷ÌåÖдò¿ª£¬ÍÑÀë¿ò¼Ü£©

Example
¾ÙÀý

The following example changes the target of the link in the image-map:
ÏÂÃæµÄ¾ÙÀý½«¸Ä±äÈȵãͼƬÖÐÁ¬½ÓµÄ´ò¿ª·½Ê½£º

<html>
<head>
<script type="text/javascript">
function changeTarget()
  {
  document.getElementById('venus').target="_blank"
  }
</script>
</head>
<body>
<img src ="planets.gif"
width="145" height="126"
alt="Planets"
usemap ="#planetmap" />
<map name ="planetmap">
<area shape ="circle" coords ="124,58,8"
href ="venus.htm" id="venus" />
</map>
<br />
<input type="button" onclick="changeTarget()" 
value="Change target" />
</body>
</html>


ÑÝÁ·

Change the target of a link in an image-map
¸Ä±äÈÈµãµØÍ¼µÄÁ¬½Ótarget

ÆÀÂÛ (0) All