Edit this page

up.element up.element.matches(element, selector)
JavaScript function

This feature has been deprecated. Use Element#matches() instead.

Load unpoly-migrate.js to polyfill deprecated features.

Returns whether the given element matches the given CSS selector.

To match against a non-standard selector like :main, use up.fragment.matches() instead.

Parameters

element Element

The element to check.

selector string

The CSS selector to match.

Return value

boolean

Whether element matches selector.