Attr Class

https://dom.spec.whatwg.org/#interface-attr

public sealed class Attr : Node
Inheritance
Node Attr

Properties

NameDescription
LocalNameGets the local name of the attribute.
NameThe qualified name (https://dom.spec.whatwg.org/#concept-attribute-qualified-name).
NamespaceUriGets the namespace of the attribute, or null when it has none.
NodeNameGets the qualified name of the attribute.
NodeTypeGets the type of the node, which is always ATTRIBUTE_NODE.
NodeValueGets or sets the value of the attribute.
OwnerElementGets the element that owns the attribute, or null when the attribute is detached.
PrefixGets the namespace prefix of the attribute, or null when it has none.
SpecifiedAlways true (https://dom.spec.whatwg.org/#dom-attr-specified).
TextContentGets or sets the value of the attribute.
ValueGets or sets the value of the attribute.

LocalName

Attr.cs

Gets the local name of the attribute.

public string LocalName { get; }

The qualified name (https://dom.spec.whatwg.org/#concept-attribute-qualified-name).

public string Name { get; }

NamespaceUri

Attr.cs

Gets the namespace of the attribute, or null when it has none.

public string? NamespaceUri { get; }

NodeName

Attr.cs

Gets the qualified name of the attribute.

public override string NodeName { get; }

Property value

string

NodeType

Attr.cs

Gets the type of the node, which is always ATTRIBUTE_NODE.

public override ushort NodeType { get; }

Property value

ushort

NodeValue

Attr.cs

Gets or sets the value of the attribute.

public override string? NodeValue { get; set; }

Property value

string?

OwnerElement

Attr.cs

Gets the element that owns the attribute, or null when the attribute is detached.

public Element? OwnerElement { get; }

Prefix

Attr.cs

Gets the namespace prefix of the attribute, or null when it has none.

public string? Prefix { get; }

Specified

Attr.cs

Always true (https://dom.spec.whatwg.org/#dom-attr-specified).

public bool Specified { get; }

TextContent

Attr.cs

Gets or sets the value of the attribute.

public override string? TextContent { get; set; }

Property value

string?

Value

Attr.cs

Gets or sets the value of the attribute.

public string Value { get; set; }