Area.target : Area « HTML Tags « JavaScript Tutorial






Syntax

document.links[num].target

The target property contains the name of target window or frame in which the URL should be displayed.

This property is a read/write string.

<html>
    <body>
    <map name="partsMap">
      <area name="sparkPlug"
            coords="1,1,48,48"
            href="#A"
            target="_top">
      <area name="tires"
            coords="51,1,99,49"
            href="#TIRES"
            target="_top">
      <area name="C"
            coords="1,51,51,99"
            href="#C"
            target="_top">
      <area name="D"
            coords="51,51,99,99"
            href="#D"
            target="_top">
    </map>
    <img src="http://www.java2s.com/style/logo.png" align="top"
         height="100"   width="100" usemap="#partsMap">
    <hr>
    <script language="JavaScript">
    <!--
    document.links[0].target="_blank";      

    document.links[1].target="_blank";      

    -->
    </script>
    <a name="A"><h3>A</h3></a>
    <ul>
      <li>A</li>
      <li>B</li>
      <li>C</li>
    </ul>
    <a name="B"><h3>B</h3></a>
    <ul>
      <li>AA</li>
      <li>BB</li>
      <li>CC</li>
    </ul>
    <a name="C"><h3>C</h3></a>
    <ul>
      <li>C1</li>>
      <li>C2</li>
    </ul>
    <a name="D"><h3>D</h3></a>
    <ul>
      <li>Red</li>
      <li>Yellow</li>
      <li>Green</li>
      <li>Blue</li>
    </ul>
    </body>
    </html>








21.4.Area
21.4.1.Area
21.4.2.Area.handleEvent()
21.4.3.Area.host
21.4.4.Area.hostname
21.4.5.Area.href
21.4.6.Area.onDblClick
21.4.7.Area.onMouseOut
21.4.8.Area.onMouseOver
21.4.9.Area.pathname
21.4.10.Area.port
21.4.11.Area.protocol
21.4.12.Area.search
21.4.13.Area.target