Area : Area « HTML Tags « JavaScript Tutorial

JavaScript Tutorial
1. Language Basics
2. Operators
3. Statement
4. Development
5. Number Data Type
6. String
7. Function
8. Global
9. Math
10. Form
11. Array
12. Date
13. Dialogs
14. Document
15. Event
16. Location
17. Navigator
18. Screen
19. Window
20. History
21. HTML Tags
22. Style
23. DOM Node
24. Drag Drop
25. Object Oriented
26. Regular Expressions
27. XML
28. GUI Components
29. Animation
30. MS JScript
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
JavaScript Tutorial » HTML Tags » Area 
21. 4. 1. Area

An instance of the Area object is created with each occurrence of the tag within an HTML document.

In HTML documents, the tag is used in conjunction with the tag to define an area within a picture that will act as a hyperlink.

Because the Area object is a hyperlink, it is equivalent to the Link object in JavaScript.

The Area object is stored in the same array where Link objects are stored.

Properties/Methods/Event HandlersDescription
hashThe portion of the URL that is the anchor, including the # symbol
hostThe hostname (IP address) and port specified in the URL
hostnameThe hostname specified within the URL
hrefThe entire URL
pathnameThe path of the file specified in the URL beginning with the / symbol
portThe port specified in the URL
protocolThe protocol specified in the URL, including the ending colon (:)
searchThe search part of the URL, including the beginning question mark (?)
targetThe name of the target window in which the URL should be displayed
handleEvent()Calls the event handler associated with this event
onDblClickInvoked when the mouse is double-clicked while in the region defined by the Area object
onMouseOutInvoked when the mouse moves outside the region defined by the Area object
onMouseOverInvoked when the mouse moves into the region defined by the Area object


 
    <html>
    <body>
    <map name="colorMap">
      <area name="redArea"
            coords="1,1,48,48"
            href="http://www.java2s.com"
            target="_top"
            onMouseOver="overBox(0)"
            onMouseOut="clearBox()">
      <area name="greenArea"
            coords="51,1,99,49"
            href="http://www.java2s.com"
            target="_top"
            onMouseOver="overBox(1)"
            onMouseOut="clearBox()">
      <area name="yellowArea"
            coords="1,51,51,99"
            href="http://www.java2s.com"
            target="_top"
            onMouseOver="overBox(2)"
            onMouseOut="clearBox()">
      <area name="blueArea"
            coords="51,51,99,99"
            href="http://www.java2s.com"
            target="_top"
            onMouseOver="overBox(3)"
            onMouseOut="clearBox()">
    </map>
    <img src="http://www.java2s.com/style/logo.png" align="top"
         height="100"   width="100" usemap="#colorMap">
    <br><br><b><u>AREA Properties</u></b>
    <form name="myForm">
      hash=<input name="tHash" type="textarea"><br>
      host=<input name="tHost" type="textarea"><br>
      hostname=<input name="tHostName" type="textarea"><br>
      href=<input name="tHref" type="textarea"><br>
      pathname<input name="tPathName" type="textarea"><br>
      port=<input name="tPort" type="textarea"><br>
      protocol=<input name="tProtocol" type="textarea"><br>
      search=<input name="tSearch" type="textarea"><br>
      target=<input name="tTarget" type="textarea"><br>
    </form>
    <script language="javascript">
    <!--
    function overBox(num) {
      document.myForm.tHash.value = document.links[num].hash;
      document.myForm.tHost.value = document.links[num].host;
      document.myForm.tHostName.value = document.links[num].hostname;
      document.myForm.tHref.value = document.links[num].href;
      document.myForm.tPathName.value = document.links[num].pathname;
      document.myForm.tPort.value = document.links[num].port;
      document.myForm.tProtocol.value = document.links[num].protocol;
      document.myForm.tSearch.value = document.links[num].search;
      document.myForm.tTarget.value = document.links[num].target;
    }

    function clearBox()  {
      document.myForm.tHash.value = "";
      document.myForm.tHost.value = "";
      document.myForm.tHostName.value = "";
      document.myForm.tHref.value = "";
      document.myForm.tPathName.value = "";
      document.myForm.tPort.value = "";
      document.myForm.tProtocol.value = "";
      document.myForm.tSearch.value = "";
      document.myForm.tTarget.value = "";
    }
    // End Hide-->
    </script>
    </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
w___w___w.__jav_a_2_s.c_o__m___ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.