Type of element to select attribute from.
Attribute name to include in the selector.
Optionalvalue: null | AttributeValue = undefinedOptional attribute value to include in the selector.
OptionaltagName: stringOptional tagName name to include in the selector.
CSS selector based on the attribute name and optional value and tagName.
InvalidAttributeError if the specified value could not be stringified.
Name Only
selectAttribute("disabled");
// [disabled]
Name and Value
selectAttribute("disabled", true);
// [disabled="true"]
Name, Value, and Tag
selectAttribute("disabled", true, "button");
// button[disabled="true"]
Name and Tag (No Value)
selectAttribute("disabled", null, "button");
// button[disabled]
Attempts to build a CSS selector string from the attribute
nameandvalue. Note that thevalueis coerced to a string andnullexcludes a value but only includes a name. IftagNameis specified, it is included in the resulting selector.If you specify the optional
Egeneric, you'll get autocomplete on the attributes for the element associated with that type.