Table of Contents

Class Attr

Namespace
AngleSharp.Dom
Assembly
AngleSharp.dll

Represents a generic node attribute.

public sealed class Attr : IAttr, INode, IEventTarget, IMarkupFormattable, IEquatable<IAttr>
Inheritance
Attr
Implements
Inherited Members
Extension Methods

Constructors

Attr(string)

Creates a new attribute with the given local name.

public Attr(string localName)

Parameters

localName string

The local name of the attribute.

Attr(string, string)

Creates a new attribute with the given local name and value.

public Attr(string localName, string value)

Parameters

localName string

The local name of the attribute.

value string

The value of the attribute.

Attr(string?, string, string, string?)

Creates a new attribute with the given properties.

public Attr(string? prefix, string localName, string value, string? namespaceUri)

Parameters

prefix string

The prefix of the attribute.

localName string

The local name of the attribute.

value string

The value of the attribute.

namespaceUri string

The namespace of the attribute.

Properties

IsId

Gets if the attribute is an id attribute.

public bool IsId { get; }

Property Value

bool

IsSpecified

Gets always true.

public bool IsSpecified { get; }

Property Value

bool

LocalName

Gets the attribute's local name.

public string LocalName { get; }

Property Value

string

Name

Gets the attribute's fully qualified name.

public string Name { get; }

Property Value

string

NamespaceUri

Gets the attribute's namespace.

public string? NamespaceUri { get; }

Property Value

string

OwnerElement

Gets the owner of the attribute, if any.

public IElement? OwnerElement { get; }

Property Value

IElement

Prefix

Gets the attribute's prefix.

public string? Prefix { get; }

Property Value

string

Specified

Gets if the value is given or not.

public bool Specified { get; }

Property Value

bool

Value

Gets the attribute's value.

public string Value { get; set; }

Property Value

string

Methods

Equals(IAttr?)

Checks if the attribute equals another attribute.

public bool Equals(IAttr? other)

Parameters

other IAttr

The other attribute.

Returns

bool

True if both are equivalent, otherwise false.

GetHashCode()

Computes the hash code of the attribute.

public override int GetHashCode()

Returns

int

The computed hash code.