Javascript (JS) Area Examples: HTML DOM Object – Javascript (JS) Area Examples
Javascript (JS) Area Examples: HTML DOM Object – Javascript (JS) Area Examples
Purpose: – Illustrates the JavaScript syntax for working with the Area Object. An Area allows you to create a hyperlink to another document or to a different point in the same document. The href property allows an Area to link to another document, and the name property allows the Area to link to another point within the current document. There are two ways to find Areas in a document: 1) use getElementById(); or 2) search through the Areas() array in the document object.
Area Object Examples
Standard Properties | |
className | Allows you to access the class attribute of an element |
dir | Allows you to access the direction of text |
lang | Allows you to access to the language code for an element |
title | Allows you to access an element’s advisory title |
Area Object Properties | |
accessKey | Allows you to access a keyboard key to access an area |
alt | Allows you to access the alternate text for an area object |
coords | Allows you to access a comma-separated list with coordinates of an area object in an image-map |
hash | Allows you to access the anchor part of the URL in an area |
host | Allows you to access the hostname and port of the URL in an area |
href | Allows you to access the URL of a link in an image-map |
id | Allows you to access the id of an area |
noHref | Allows you to access whether an area should be active or inactive |
pathname | Allows you to access the pathname of the URL in an area |
protocol | Allows you to access the protocol of the URL in an area |
search | Allows you to access the query string part of the URL in an area |
shape | Allows you to access the shape of a link in an area |
tabIndex | Allows you to access the tab order for an area |
target | Allows you to access the where to open the link-url in an area |