Returns true if the selector provided matches the element in question
xtag.matchSelector(ELEMENT, SELECTOR)
xtag.matchSelector(ELEMENT, SELECTOR)
Argument | Type | Description |
---|---|---|
ELEMENT | DOM element reference | The element to test the selector string against. |
SELECTOR | CSS selector string | The CSS expression provided to test against the passed in element. |
xtag.matchSelector(myElement, '.foo');
// returns true if the element has the class 'foo', false if not.