Sha256: 99c48be2fa8e0d06761f58215893a744dd1a7d3f70386c58068bea4a9e988e32
Contents?: true
Size: 1.07 KB
Versions: 115
Compression:
Stored size: 1.07 KB
Contents
/* exported matches */ /** * Check if a DOM element matches a definition * * Example: * ```js * // Match a single nodeName: * axe.commons.matches(elm, 'div') * * // Match one of multiple nodeNames: * axe.commons.matches(elm, ['ul', 'ol']) * * // Match a node with nodeName 'button' and with aria-hidden: true: * axe.commons.matches(elm, { * nodeName: 'button', * attributes: { 'aria-hidden': 'true' } * }) * * // Mixed input. Match button nodeName, input[type=button] and input[type=reset] * axe.commons.matches(elm, ['button', { * nodeName: 'input', // nodeName match isn't case sensitive * properties: { type: ['button', 'reset'] } * }]) * ``` * * @namespace matches * @memberof axe.commons * @param {HTMLElement|VirtualNode} node node to verify attributes against constraints * @param {Array<ElementDefinition>|String|Object|Function|Regex} definition * @return {Boolean} true/ false based on if node passes the constraints expected */ function matches(node, definition) { return matches.fromDefinition(node, definition); } commons.matches = matches;
Version data entries
115 entries across 115 versions & 1 rubygems