Table of Contents

Class HTMLAnchorElement

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The HTMLAnchorElement interface represents hyperlink elements and provides special properties and methods (beyond those of the regular HTMLElement object interface that they inherit from) for manipulating the layout and presentation of such elements. This interface corresponds to <a> element; not to be confused with <link>, which is represented by HTMLLinkElement.

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

Remarks

-The HTML element implementing this interface: a

See also on MDN

Constructors

HTMLAnchorElement()

public HTMLAnchorElement()

Properties

AttributionSourceId

[Value("attributionSourceId")]
public ulong AttributionSourceId { get; set; }

Property Value

ulong

Charset

[Value("charset")]
public string Charset { get; set; }

Property Value

string

Coords

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

Property Value

string

Download

The HTMLAnchorElement.download property is a
string indicating that the linked resource is intended to be
downloaded rather than displayed in the browser. The value, if any, specifies the
default file name for use in labeling the resource in a local file system. If the name
is not a valid file name in the underlying OS, the browser will adjust it.

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

Property Value

string

A string.

Remarks

NOTE

This value might not be used for download. This value cannot
be used to determine whether the download will occur.

See also on MDN

Hreflang

The hreflang property of the HTMLAnchorElement interface is a string that is the language of the linked resource.

[Value("hreflang")]
public string Hreflang { get; set; }

Property Value

string

A string that contains a language tag, or the empty string ("") if there is no hreflang element.

Remarks

It reflects the hreflang attribute of the a element and is the empty string ("") if there is no hreflang element.

Web browsers and search engines may use this information to understand the language of the linked content better, but they are not required to follow it. The value provided for the hreflang attribute adheres to the format defined in {{RFC(5646, "Tags for Identifying Languages (also known as BCP 47)")}}. If not, it is ignored.

Web browsers do not rely solely on the hreflang attribute after fetching the linked resource. Instead, they use language information directly associated with the resource (e.g., through HTTP headers) to determine its language.

-Hreflang property

See also on MDN

Name

[Value("name")]
public string Name { get; set; }

Property Value

string

Ping

The ping property of the HTMLAnchorElement 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 a 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
HTMLAnchorElement.referrerPolicy
property reflect the HTML referrerpolicy attribute of the
a 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 HTMLAnchorElement.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 a element and the current document.

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

Property Value

string

A string.

Remarks

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

See also on MDN

RelList

The HTMLAnchorElement.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("a")}} 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 with another one, but its contents can still be changed.

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

See also on MDN

Rev

[Value("rev")]
public string Rev { get; set; }

Property Value

string

Shape

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

Property Value

string

Target

The target property of the HTMLAnchorElement 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 a element.

-Target property
-Target property
-Target property

See also on MDN

Text

The text property of the HTMLAnchorElement represents the text inside the element.
This property represents the same information as TextContent.

[Value("text")]
public string Text { get; set; }

Property Value

string

A string.

Remarks

-Text property
-Text property

See also on MDN

Type

The type property of the HTMLAnchorElement interface is a string that indicates the MIME type of the linked resource.

[Value("type")]
public string Type { get; set; }

Property Value

string

A string.

Remarks

It reflects the type attribute of the a element.

-Type property
-Type property
-Type property

See also on MDN