HTMLAreaElement : HTMLElement
Return to: HTML DOM Level 5 index

Represents either a hyperlink with some text and a corresponding area on an image map, or a dead area on an image map.

Platform Support

Mozilla Chrome Safari Opera IE Netscape
1.0+ 5.0+ 1.0+ 4.0+ 2.0+ 1.0+

Constructors

Constructor Action Mozilla Chrome Safari Opera IE Netscape
HTMLAreaElement Constructor() : HTMLAreaElement
Area or hyperlink in an HTML document.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 2.0+ 1.0+

HTMLAreaElement() : HTMLAreaElement

Area or hyperlink in an HTML document.

Returns
HTMLAreaElement

Visibility
internal

Properties

Property Action Mozilla Chrome Safari Opera IE Netscape
alt : String
Alternate text for an area.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 2.0+ 1.0+
Availability

WhatWG

coords : String
Coordinates of an area.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 2.0+ 1.0+
Availability

WhatWG

shape : String
Shape of an area.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 2.0+ 1.0+
Availability

WhatWG

href : String
Specifies that an area has no associated link.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 2.0+ 1.0+
Availability

WhatWG

target : String
Specifies where to open the linked page specified in the href attribute.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 2.0+ 1.0+
Availability

WhatWG

ping : String
Gives the URLs to be notified if the user follows the hyperlink. Only to be used when the href attribute is present.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 2.0+ 1.0+
Availability

WhatWG

rel : String
Describes the relationship between the current document and the destination URI. Only to be used when the href attribute is present.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 2.0+ 1.0+
Availability

WhatWG

relList : DOMTokenList
A list of relationships between the current document and the destination URI.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 2.0+ 1.0+
Availability

WhatWG

media : String
Specifies which media the target URL uses. Only to be used when the href attribute is present.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 2.0+ 1.0+
Availability

WhatWG

hreflang : String
Language code of the destination URL. Only to be used when the href attribute is present.
Show Details 1.0+ 5.0+ 1.0+ 4.0+ 2.0+ 1.0+
Availability

WhatWG

type : String
Specifies the MIME type of the linked resource. Only to be used when the href attribute is present.
No Details 1.0+ 5.0+ 1.0+ 4.0+ 2.0+ 1.0+

Inherited Functions

Method Action Mozilla Chrome Safari Opera IE Netscape
getElementsByClassName(String classNames) : NodeList
Returns a NodeList containing all the Element nodes with the specified classNames.
Show Details 1.9+ 5.0+ 3.1+ 9.51+ no no

Parameters
String classNames (one-or-more)A string representing the class name(s) of the elements to return. Multiple class names should be separated by spaces.

Returns
NodeList

Using getElementsByClassName

                        	                    document.getElementById("useCases").getElementsByClassName("question");

Would return a NodeList of all elements inside the element with the id "useCases" to which the class "question" applies.

                        	                    document.getElementById("useCases").getElementsByClassName("question issue");

Would return a NodeList of all elements inside the element with the id "useCases" to which both the classes "question" and "issue" apply.

Remarks

Returns a list of child elements to which the specified className applies. The returned NodeList is sorted in tree order (the order the elements were found during a depth-first preorder traversal through the node tree).

See Also

Document.getElementsByClassName|Element.getElementsByClassName|HTMLDocument.getElementsByClassName

Availability

HTML 5|W3C|W3C

Examples

References

HTMLAreaElement

Availability

JavaScript 1.2|WhatWG

text_javascript aptana_docs