August 1999
Intermediate to advanced
1488 pages
72h 53m
English
document.anchors[num].x
The x property contains the x-coordinate of the anchor, in pixels, from the left edge of the document to the anchor.
Listing 7.4 creates a single anchor out of a header at the top of the document. The x property is used to display the horizontal position of the Anchor object on the bottom of the page.
<html> <center><a name="A"><h4>Apple</h4></a></center> A round, juicy fruit that comes in red, yellow, and green.<hr> <script language="JavaScript"> <!-- Hide //Display the x property of the anchor document.write("The x property is equal to ",document.anchors[0].x); // ---End Hide> </script> </html> ... |
Read now
Unlock full access