Table of Contents

Class HTMLAreaElement

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The HTMLAreaElement interface provides special properties and methods (beyond those of the regular object HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of {{HtmlElement("area")}} elements.

[Value("HTMLAreaElement")]
public class HTMLAreaElement : HTMLElement, HTMLAttributionSrcElementUtils, HTMLHyperlinkElementUtils
Inheritance
HTMLAreaElement
Implements
Inherited Members

Remarks

-HTML element implementing this interface: area

See also on MDN

Constructors

HTMLAreaElement()

public HTMLAreaElement()

Properties

Alt

The alt property of the HTMLAreaElement interface specifies the text of the hyperlink, defining the textual label for an image map's link. It reflects the {{htmlelement("area")}} element's alt attribute.

[Value("alt")]
public string Alt { get; set; }

Property Value

string

A string.

Remarks

The alt value must be text that, when presented with the alt text of the other <area> hyperlinks within the same map, along with the alt text of the img itself, provides the user with the same kind of choice as the hyperlink would when used without its text but with its shape applied to the image.

If the {{htmlelement("area")}} is a link (contains an HTMLAreaElement.Href property), the alt property value should be a non-empty string giving the label for the link that would be appropriate if the image were unavailable. The alt attribute for a link <area> can only be empty if there is another <area> element in the same <map> that points to the same resource and has a non-blank alt attribute.

-Alt
-Alt
-HTMLMapElement
-area
-map
-a
-Good alt text, bad alt text — Making your content perceivable on WCAG.com (2021)
-An alt decision tree on W3C Web Accessibility Initiative (WAI)

See also on MDN

Coords

The coords property of the HTMLAreaElement interface specifies the coordinates of the element's shape as a list of floating-point numbers. It reflects the {{htmlelement("area")}} element's coords attribute.

[Value("coords")]
public string Coords { get; set; }

Property Value

string

A string; composed of a comma separated series of numbers.

Remarks

If the shape is rect, the shape is a rectangle and the string value's four comma separated numbers specify the coordinates of the top-left and bottom-right corners of the rectangle. For example, 0,0,200,20 defines the coordinates as 0,0, which is the top-left of the image map, and 200,20, which is 200px from the left and 20px from the top of the top-left corner of the image map.

If the shape is circle, the three comma-separated numbers represent the x and y coordinates of the circle's center and the radius.

If the shape is poly, the string consists of at least 6 comma-separated numbers representing at least 3 pairs of coordinates that define the vertices of the polygon.

For all coordinates, the origin is the top-left corner of the map element's image.

-Shape
-Alt
-HTMLMapElement
-area
-map
-a

See also on MDN

Download

The download property of the HTMLAreaElement interface is a string indicating that the linked resource is intended to be downloaded rather than displayed in the browser. The value represent the proposed name of the file. If the name is not a valid filename of the underlying OS, browser will adjust it accordingly.

[Value("download")]
public string Download { get; set; }

Property Value

string

A string.

Remarks

It reflects the download attribute of the area element.

See also on MDN

NoHref

[Value("noHref")]
public bool NoHref { get; set; }

Property Value

bool

Ping

The ping property of the HTMLAreaElement interface is a space-separated list of URLs. When the link is followed, the browser will send {{HTTPMethod("POST")}} requests with the body PING to the URLs.

[Value("ping")]
public string Ping { get; set; }

Property Value

string

Remarks

It reflects the ping attribute of the area element.

NOTE

This property is not effective in Firefox and its usage may be limited due to privacy and security concerns.

-Ping property

See also on MDN

ReferrerPolicy

The
HTMLAreaElement.referrerPolicy
property reflect the HTML referrerpolicy attribute of the
area element defining which referrer is sent when fetching the
resource.

[Value("referrerPolicy")]
public string ReferrerPolicy { get; set; }

Property Value

string

A string; one of the following:

Remarks

Rel

The HTMLAreaElement.rel property reflects the rel attribute. It is a string containing a space-separated list of link types indicating the relationship between the resource represented by the area element and the current document.

[Value("rel")]
public string Rel { get; set; }

Property Value

string

A string.

Remarks

-The equivalent property on a and link,
Rel and Rel.
-The very same list but as tokens: RelList

See also on MDN

RelList

The HTMLAreaElement.relList read-only property reflects the rel attribute. It is a live DOMTokenList containing the set of link types indicating the relationship between the resource represented by the {{HTMLElement("area")}} element and the current document.

[Value("relList")]
public DOMTokenList RelList { get; }

Property Value

DOMTokenList

A live DOMTokenList of strings.

Remarks

The property itself is read-only, meaning you can't substitute the
DOMTokenList by another one, but the content of the returned list can be
changed.

-The equivalent property on a and link,
RelList and RelList.
-The very same list but as a space-separated tokens in a string:
Rel

See also on MDN

Shape

The shape property of the HTMLAreaElement interface specifies the shape of an image map area. It reflects the {{htmlelement("area")}} element's shape attribute.

[Value("shape")]
public string Shape { get; set; }

Property Value

string

A string; rect, circle, or poly.

Remarks

Target

The target property of the HTMLAreaElement interface is a string that indicates where to display the linked resource.

[Value("target")]
public string Target { get; set; }

Property Value

string

A string representing the target. Its value can be:

Remarks

It reflects the target attribute of the area element.

-Target property
-Target property
-Target property

See also on MDN