Table of Contents

Interface IHtmlElement

Namespace
AngleSharp.Html.Dom
Assembly
AngleSharp.dll

The HTMLElement interface represents any HTML element. Some elements directly implement this interface, other implement it via an interface that inherit it.

[DomName("HTMLElement")]
public interface IHtmlElement : IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IGlobalEventHandlers
Inherited Members
Extension Methods

Properties

AccessKey

Gets or sets the access key assigned to the element.

[DomName("accessKey")]
string? AccessKey { get; set; }

Property Value

string

AccessKeyLabel

Gets the element's assigned access key.

[DomName("accessKeyLabel")]
string? AccessKeyLabel { get; }

Property Value

string

ContentEditable

Gets or sets whether or not the element is editable. This enumerated attribute can have the values true, false and inherited.

[DomName("contentEditable")]
string? ContentEditable { get; set; }

Property Value

string

ContextMenu

Gets or sets the assigned context menu.

[DomName("contextMenu")]
IHtmlMenuElement? ContextMenu { get; set; }

Property Value

IHtmlMenuElement

Dataset

Gets access to all the custom data attributes (data-*) set on the element. It is a map of DOMString, one entry for each custom data attribute.

[DomName("dataset")]
IStringMap Dataset { get; }

Property Value

IStringMap

Direction

Gets or sets the value of the dir attribute.

[DomName("dir")]
string? Direction { get; set; }

Property Value

string

DropZone

Gets the dropzone for this element.

[DomName("dropzone")]
[DomPutForwards("value")]
ISettableTokenList DropZone { get; }

Property Value

ISettableTokenList

IsContentEditable

Gets if the element is currently contenteditable.

[DomName("isContentEditable")]
bool IsContentEditable { get; }

Property Value

bool

IsDraggable

Gets or sets if the element is draggable.

[DomName("draggable")]
bool IsDraggable { get; set; }

Property Value

bool

IsHidden

Gets or sets if the element is hidden.

[DomName("hidden")]
bool IsHidden { get; set; }

Property Value

bool

IsSpellChecked

Gets or sets if spell-checking is activated.

[DomName("spellcheck")]
bool IsSpellChecked { get; set; }

Property Value

bool

IsTranslated

Gets or sets if the element should be translated.

[DomName("translate")]
bool IsTranslated { get; set; }

Property Value

bool

Language

Gets or sets the value of the lang attribute.

[DomName("lang")]
string? Language { get; set; }

Property Value

string

TabIndex

Gets or sets the position of the element in the tabbing order.

[DomName("tabIndex")]
int TabIndex { get; set; }

Property Value

int

Title

Gets or sets the value of the title attribute.

[DomName("title")]
string? Title { get; set; }

Property Value

string

Methods

DoBlur()

Removes the keyboard focus on the given element.

[DomName("blur")]
void DoBlur()

DoClick()

Simulates a mouse click on an element.

[DomName("click")]
void DoClick()

DoFocus()

Puts the keyboard focus on the given element.

[DomName("focus")]
void DoFocus()

DoSpellCheck()

Forces the invocation of a spell check on the content.

[DomName("forceSpellCheck")]
void DoSpellCheck()