Skip to content

DOMPurifyI.isValidAttribute method

DOMPurifyI › isValidAttribute

Unofficial

Check if an attribute is valid for a given tag.

Signature:

isValidAttribute(tag: string, attr: string, value: string): boolean

Parameters:

ParameterTypeDescription
tagstringThe tag name.
attrstringThe attribute name.
valuestringThe attribute value.

Returns: booleanWhether the attribute is valid.