Area.hash
JavaScript 1.1+, JScript 1.0+ Nav3+, IE 3+, Opera3+ Syntax
document.links[num].hash
Description
The hash property associated with an Area object contains the anchor specified in the URL including the leading hash symbol (#). This property is a read/write string.
Example
Listing 7.9 creates an auto parts page that allows users to find model numbers of parts by clicking a picture of the part (see Figure 7.2). Selecting either Car or Truck at the top of the page changes the links associated with the pictures. Selecting Car or Truck causes the hash property to be modified so that the user is taken to a different location within the page.
Figure 7.2. Selecting a part causes the hash property to change.
Listing 7.9 Modifying ...
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.