Edit this page

up.element up.element.first([parent], selector)
JavaScript function

This feature has been deprecated. Use up.element.get() instead.

Load unpoly-migrate.js to polyfill deprecated features.

Returns the first descendant element matching the given selector.


Parameters

[parent=document] Element optional

The parent element whose descendants to search.

If omitted, all elements in the document will be searched.

selector string

The CSS selector to match.

Return value

The first element matching the selector.

Returns null or undefined if no element macthes.