Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

HtmlElement

Namespace OfficeIMO.Html.Dom
Assembly OfficeIMO.Html.Core
Modifiers sealed

An owned element with ordered, namespace-aware attributes.

Inheritance

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters

Methods

public HtmlElement Closest(String selector) #
Returns: HtmlElement

Finds this element or its nearest ancestor matching a selector.

Parameters

selector System.String requiredposition: 0
GetAttribute 2 overloads
public String GetAttribute(String name) #
Returns: String

Reads the first attribute with this qualified name, regardless of namespace.

Parameters

name System.String requiredposition: 0
public String GetAttribute(String namespaceUri, String localName) #
Returns: String

Reads an attribute by namespace URI and local name.

Parameters

namespaceUri System.String requiredposition: 0
localName System.String requiredposition: 1
public Boolean HasAttribute(String name) #
Returns: Boolean

Checks whether a qualified attribute is present.

Parameters

name System.String requiredposition: 0
public Boolean Matches(String selector) #
Returns: Boolean

Tests this element against a CSS selector.

Parameters

selector System.String requiredposition: 0
RemoveAttribute 2 overloads
public Void RemoveAttribute(String name) #
Returns: Void

Removes the first attribute with this qualified name, regardless of namespace.

Parameters

name System.String requiredposition: 0
public Void RemoveAttribute(String namespaceUri, String localName) #
Returns: Void

Removes an attribute by namespace URI and local name.

Parameters

namespaceUri System.String requiredposition: 0
localName System.String requiredposition: 1
public Void SetAttribute(String name, String value, String namespaceUri = null) #
Returns: Void

Adds or replaces an attribute in the supplied namespace; omitting the namespace selects the empty namespace.

Parameters

name System.String requiredposition: 0
value System.String requiredposition: 1
namespaceUri System.String = null optionalposition: 2

Properties

public String LocalName { get; } #

Element local name, preserving foreign-content case.

public String NamespaceUri { get; } #

Element namespace URI.

public String Prefix { get; } #

Namespace prefix, or an empty string.

public override String NodeName { get; } #
public IReadOnlyList<HtmlAttribute> Attributes { get; } #

Ordered attributes.

public String Id { get; } #

Value of the empty-namespace id attribute, or an empty string.

public String ClassName { get; } #

Value of the empty-namespace class attribute, or an empty string.

public IReadOnlyList<String> ClassList { get; } #

Class tokens for inspection.

public HtmlNode TemplateContent { get; set; } #

Template contents, retained separately from normal child nodes.

Fields

public const String HtmlNamespace #

HTML namespace URI.

Value: http://www.w3.org/1999/xhtml