Search criteria that can be used to determine if a DOM property is present
on an element. If an array, only the presence of the property names are
checked. If an object, the property name and value are checked.
To check for the existence of a property only (i.e. you don't care what the
value is), use null for the field.
Type Parameters
K extends string
Key of the property to search.
V
Type of the value to search for (only needed if using PropertyFilter).
Example
HTML
<buttonid="example"aria-hidden="true"aria-label="Example"> Example </button>
Code
constelement = findElement("#example")!;
constresult = hasAllAttributes(element, { "aria-hidden":true, // Setting to null means "only check if property exists" "aria-label":null, }); // true
Search criteria that can be used to determine if a DOM property is present on an element. If an array, only the presence of the property names are checked. If an object, the property name and value are checked.
To check for the existence of a property only (i.e. you don't care what the value is), use
null
for the field.