up.element.get([parent], value)
JavaScript function
Returns the native Element for the given value.
This function is not aware of layers or elements being destroyed
and does not support non-standard selectors like :main. For this, use up.fragment.get().
Casting rules
- If given an element, returns that element.
- If given a CSS selector string, returns the first element matching that selector.
- If given a jQuery collection, returns the first element in the collection. Throws an error if the collection contains more than one element.
- If given any other argument (
undefined,null,document,window…), returns the argument unchanged.
Example
Passing a CSS selector will return the first matching element:
up.element.get('.foo') // returns the first matching element
Parameters
[parent=document]
optional
The parent element whose descendants to search if value is a CSS selector string.
If omitted, all elements in the document will be searched.
Type: Element