Anchor : Anchor : HTML Tags JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » HTML Tags » Anchor »

 

Anchor









An instance of the Anchor object is created with each instance of the























Properties Description
name A name that provides access to the anchor from a link
text The text that appears between the tags
x The x-coordinate of the anchor
y The 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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo HTML Tags
» Anchor