The up.element
module offers functions for DOM manipulation and traversal.
It complements native Element
methods and works across all supported browsers.
Matches all elements that have a descendant matching the given selector.
Sets an unique identifier for this element.
Creates an element matching the given CSS selector and attaches it to the given parent element.
Returns all descendant elements matching the given selector.
Returns the value of the given attribute on the given element, cast as a boolean value.
Returns the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
Creates an element from the given HTML fragment.
Creates an element matching the given CSS selector.
Returns the first descendant element matching the given selector.
Casts the given value to a native Element.
Hides the given element.
Returns whether the given element is currently visible.
Reads the given attribute from the element, parsed as JSON.
Returns whether the given element matches the given CSS selector.
Returns the value of the given attribute on the given element, cast to a number.
Removes the given element from the DOM tree.
Replaces the given old element with the given new element.
Sets all key/values from the given object as attributes on the given element.
Sets the given CSS properties as inline styles on the given element.
Shows the given element.
Receives computed CSS styles for the given element.
Receives a computed CSS property value for the given element, casted as a number.
Returns a list of the given parent's descendants matching the given selector. The list will also include the parent element if it matches the selector itself.
Display or hide the given element, depending on its current visibility.
Adds or removes the given class from the given element.
Returns a CSS selector that matches the given element as good as possible.