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
required

The element to check.

selector
required

The CSS selector to match.

string

Return value

Whether element matches selector.

boolean