Error thrown when an attribute is invalid for the operation.
Valid type for HTML/SVG attribute name.
Valid attribute names for the element of tag name TN
.
Valid key/value pair representing HTML/SVG attributes (prior to stringifying).
Some of the values may be null
or undefined
.
Valid key/value pair representing HTML/SVG attributes (prior to stringifying). All the values must be defined.
Search criteria for checking if attributes are present in an element.
You can use an array of attribute names to check only if the attributes are
present, or an object to search for specific values. Use null
for the value
if you only care about the presence of an attribute.
Value type that can be specified as the value for an HTML/SVG attribute.
Attempts to get the attribute name
from the target
. If the value is found,
it is coerced to a boolean if "true"
or "false"
, a number if numeric, or
the string value if a string. If not found, returns null
.
Builds an object with the keys equal to the attribute names
and the value
equal to the corresponding attribute value in the target
. If the value is
found it is coerced to a boolean if "true"
or "false"
, a number if
numeric, or the string value if a string. If not found, the value is null
.
Checks if the target
has all of the attributes that match the search
criteria.
Checks if the target
has the attribute name
. If a value
is specified,
checks that the values match.
Checks if the target
has some of the attributes that match the search
criteria.
Removes the attribute name
from the target
.
Removes the attributes with names
from the target
.
Attempts to build a CSS selector string from the attribute name
and value
.
Note that the value
is coerced to a string and null
excludes a value but
only includes a name. If tagName
is specified, it is included in the
resulting selector.
Attempts to build a CSS selector string from the attributes
object. Note
that the values of the attributes
object are coerced to a string and null
excludes
a value but only includes a name. If tagName
is specified, it is included in the
resulting selector.
Sets the attribute name
of the target
element to the value
. The value
is coerced to a string.
Sets the attributes of the target
to the attributes
object, where the key of
the object is the attribute name and the value of the object is the attribute
value.
This module provides functions for querying and manipulating attributes on HTML and SVG elements.