Anchor : Anchor « 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
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
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
JavaScript Tutorial » HTML Tags » Anchor 
21. 2. 1. Anchor

An instance of the Anchor object is created with each instance of the tag with the NAME attribute set. An anchor itself is a point in an HTML document that can be reached by using a hypertext link. Anchors allow access to specific parts of Web pages rather than always displaying the top of a document when a Web page is loaded in a browser.

PropertiesDescription
nameA name that provides access to the anchor from a link
textThe text that appears between the and tags
xThe x-coordinate of the anchor
yThe y-coordinate of the anchor


The following example creates Anchors in a Document.

<html>
    <center>
    Pick a letter:
    <a href="#A">A</a>|<a href="#B">B</a>|<a href="#C">C</a>
    </center>
    <hr><a name="A"><h4>The Letter A</h4></a>
    A<br>
     B<br>
    <hr><a name="B"></a>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    C<br>
    D<br>
    F<br>
    <hr><a name="C"></a>
    G<br>
    H<br>
    <script language="JavaScript">
    <!--
    document.write("<hr>The Anchor Properties:<br>");

    for(var counter=0; counter<=document.anchors.length; counter++)
    {
      document.write("anchors[",counter,"].name=");

      document.write(document.anchors[counter].name,"<br>");

      document.write("anchors[",counter,"].text=");

      document.write(document.anchors[counter].text,"<br>");

      document.write("anchors[",counter,"].x=");

      document.write(document.anchors[counter].x,"<br>");

      document.write("anchors[",counter,"].y=");

      document.write(document.anchors[counter].y,"<br>");

    }
    -->
    </script>
    </html>
21. 2. Anchor
21. 2. 1. Anchor
21. 2. 2. Anchor.name
21. 2. 3. Anchor.text
21. 2. 4. Anchor.x
21. 2. 5. Anchor.y
w___w___w.j_a___v___a___2s___.___co___m___ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.