Coffeekraken.io 0.0.1

matches

Polyfill for the Element.matches function

Name Type Description Status Default
elm { HTMLElement } The element to check required
selector { String } The selector to check on the element required

Return { Boolean } If the element match the selector or not

Example

    import matches from 'sugarcss/js/dom/matches'
if (matches(myCoolHTMLElement, '.my-cool-css-selector')) {
        // the element match the selector
}

See more : https://developer.mozilla.org/en/docs/Web/API/Element/matches

Author : Olivier Bossel olivier.bossel@gmail.com