AngleSharp by AngleSharp

<PackageReference Include="AngleSharp" Version="1.0.5" />

.NET API 893,952 bytes

 IElement

The Element interface represents an object within a DOM document.

Gets the assigned slot of the current element, if any.

Gets the sequence of associated attributes.

Gets the list of class names.

string ClassName { get; set; }

Gets or sets the value of the class attribute.

string GivenNamespaceUri { get; }

Gets the given namespace URI of this element. This one will not be resolved via its parent, but only yields the provided namespace, if any.

string Id { get; set; }

Gets or sets the id value of the element.

string InnerHtml { get; set; }

Gets or sets the inner HTML (excluding the current element) of the element.

bool IsFocused { get; }

Gets if the element is currently focused.

string LocalName { get; }

Gets the local part of the qualified name of this element.

string NamespaceUri { get; }

Gets the namespace URI of this element.

string OuterHtml { get; set; }

Gets or sets the outer HTML (including the current element) of the element.

string Prefix { get; }

Gets the namespace prefix of this element.

Gets the shadow root of the current element, if any.

string Slot { get; set; }

Gets the value of the slot attribute.

Gets the source reference if available.

string TagName { get; }

Gets the name of the tag that represents the current element.

Creates a new shadow root for the current element, if there is none already.

IElement Closest(string selectors)

Returns the closest ancestor of the current element (or the current element itself) which matches the selectors given in the parameter.

string GetAttribute(string name)

Returns the value of the named attribute on the specified element.

string GetAttribute(string namespaceUri, string localName)

Returns the value of the named attribute on the specified element.

Returns a set of elements which have all the given class names.

Returns a NodeList of elements with the given tag name. The complete document is searched, including the root node.

IHtmlCollection<IElement> GetElementsByTagNameNS(string namespaceUri, string tagName)

Returns a list of elements with the given tag name belonging to the given namespace. The complete document is searched, including the root node.

bool HasAttribute(string name)

Returns a boolean value indicating whether the specified element has the specified attribute or not.

bool HasAttribute(string namespaceUri, string localName)

Returns a boolean value indicating whether the specified element has the specified attribute or not.

void Insert(AdjacentPosition position, string html)

Inserts new HTML elements specified by the given HTML string at a position relative to the current element specified by the position.

bool Matches(string selectors)

Checks if the element is matched by the given selector.

bool RemoveAttribute(string name)

Removes an attribute from the specified element.

bool RemoveAttribute(string namespaceUri, string localName)

Removes an attribute from the specified element.

void SetAttribute(string name, string value)

Adds a new attribute or changes the value of an existing attribute on the specified element.

void SetAttribute(string namespaceUri, string name, string value)

Adds a new attribute or changes the value of an existing attribute on the specified element.