shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
matches
Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.query
Polyfill for the Element.matches function
Params
- elm*-HTMLElement
The element to check
- selector*-String
The selector to check on the element
Return
- -Boolean
If the element match the selector or not
Example
import { matches } from '@blackbyte/sugar/dom'
if (matches(myCoolHTMLElement, '.my-cool-css-selector')) {
// the element match the selector
}Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space