Edit this page

up.fragment up.fragment.toTarget()
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:

Example

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

Parameters

stringorElementorjQuery

The element for which to create a selector.

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