Edit this page

up.fragment up.fragment.toTarget({string|Element|jQuery})
JavaScript function

Returns a CSS selector that matches the given element as good as possible.

To build the selector, the following element properties are used in decreasing order of priority:


element = up.element.createFromHTML('<span class="klass">...</span>')
selector = up.fragment.toTarget(element) // returns '.klass'



The element for which to create a selector.

This website uses cookies to improve usability and analyze traffic.
I accept or learn more