A deep copy of the internal record of attributes
Apply the current attributes to a single HTMLElement target
Delete an attribute from this instance
An iterator of the entries of the internal map of attributes
Get an attribute value as a string or null if it is not defined
Check if a given attribute is known to this instance
Set an attribute value on the internal record of this instance.
This does NOT update any HTML element, even one used as the source. To apply an instance of Attributes to an HTML element, use the static or instance apply method.
StaticapplyApply attributes to an HTMLElement
StaticcanCheck if a given value can be formatted into an AttributeRecord
StaticformatStaticfromCreate an Attributes instance from a source element or object
StaticgetRead an attribute value from a target element
StaticgetRead an attribute from an element as a string or null if it is not set
Read an attribute from an element as a boolean or null if it is not set
Read an attribute from an element as a number or null if it is not set
or if the value parses to NaN when parsed with Number()
StaticisCheck if a string is a valid attribute name
StaticrecordGiven a compatible attribute source, retrieve a record of attributes
StaticserializeEncode any value as a string or null for use in an AttributeRecord
StaticsetSet an attribute value, or remove it if the value is null
Helper class for reading, writing, and inspecting HTML Element attributes
Remarks
While Element.getAttributeNode() and Element.attributes exist, they're quite obtuse when it comes to general web application development. This class follows patterns established by classes such as Headers or URLSearchParams.