HtmlElement
OfficeIMO.Html.Dom
An owned element with ordered, namespace-aware attributes.
Inheritance
- HtmlNode
- HtmlElement
Usage
Explore 31 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 26
- Method HtmlDocument.CreateElement
- Method HtmlDocument.QuerySelector
- Method HtmlDocument.QuerySelectorAll
- Property HtmlDocument.Body
- Property HtmlDocument.Children
- Property HtmlDocument.DocumentElement
- Property HtmlDocument.Head
- Property HtmlDocument.ParentElement
- Method HtmlDocumentFragment.QuerySelector
- Method HtmlDocumentFragment.QuerySelectorAll
- Property HtmlDocumentFragment.Children
- Property HtmlDocumentFragment.ParentElement
- Method HtmlDocumentType.QuerySelector
- Method HtmlDocumentType.QuerySelectorAll
- Property HtmlDocumentType.Children
- Property HtmlDocumentType.ParentElement
- Method HtmlElement.Closest
- Method HtmlElement.QuerySelector
- Method HtmlElement.QuerySelectorAll
- Property HtmlElement.Children
- Property HtmlElement.ParentElement
- Method HtmlNode.QuerySelector
- Method HtmlNode.QuerySelectorAll
- Property HtmlNode.Children
- Property HtmlNode.ParentElement
- Method IHtmlDomServices.QuerySelectorAll
Accepted by parameters 5
- Method HtmlCssSelector.Matches
- Method HtmlCssSelectorList.Matches
- Method HtmlDocument.GetOrCreateTemplateContent
- Method IHtmlDomServices.Matches
- Method IHtmlParserProvider.ParseFragment
Methods
public HtmlElement? Closest(string selector) #Finds this element or its nearest ancestor matching a selector.
Parameters
- selector string
Returns
HtmlElement?public string? GetAttribute(string name) #Reads the first attribute with this qualified name, regardless of namespace.
Parameters
- name string
Returns
string?public string? GetAttribute(string namespaceUri, string localName) #Reads an attribute by namespace URI and local name.
Parameters
- namespaceUri string
- localName string
Returns
string?public bool HasAttribute(string name) #Checks whether a qualified attribute is present.
Parameters
- name string
Returns
boolpublic bool Matches(string selector) #Tests this element against a CSS selector.
Parameters
- selector string
Returns
boolpublic void RemoveAttribute(string name) #Removes the first attribute with this qualified name, regardless of namespace.
Parameters
- name string
public void RemoveAttribute(string namespaceUri, string localName) #Removes an attribute by namespace URI and local name.
Parameters
- namespaceUri string
- localName string
public void SetAttribute(string name, string value, string? namespaceUri = null) #Adds or replaces an attribute in the supplied namespace; omitting the namespace selects the empty namespace.
Parameters
- name string
- value string
- namespaceUri string? = null
public void SetAttribute(HtmlAttribute replacement) #Adds or replaces an exact attribute by namespace and local name, preserving its qualified name and case.
Parameters
- replacement OfficeIMO.Html.Dom.HtmlAttribute
Inherited Methods
public HtmlNode AppendChild(HtmlNode child) #Parameters
- child HtmlNode
Returns
HtmlNodepublic HtmlElement? QuerySelector(string selector) #Parameters
- selector string
Returns
HtmlElement?public IReadOnlyList<HtmlElement> QuerySelectorAll(string selector) #Parameters
- selector string
Returns
IReadOnlyList<HtmlElement>Properties
public string LocalName { get; } #Element local name, preserving foreign-content case.
public override string NodeName { get; } #Node name for non-element nodes; elements expose their local name.
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 HtmlDocumentFragment? TemplateContent { get; internal set; } #Template contents, retained separately from normal child nodes.
public HtmlFormControlState? FormState { get; set; } #Optional immutable live form properties. Attributes and text retain their authored defaults.