PX - API

API Functions

Here are the px library functions documented so far. They can be accessed by typing into the search box at the top-right. Also, see the Documentation page for more conceptual information.

    addClass

    Add a class to selected elements

    after

    Insert XML after each selected element

    append

    Append XML to the end of selected elements child list

    appendTo

    Append selected elements to elements specified by xpath argument

    attr

    Get or set attributes for selected element(s)

    before

    Insert XML before each selected element

    children

    Select immediate children of selected elements

    clone

    Clone a copy of selected elements

    detach

    Detach selected elements from the document

    doc

    Access the DOM document and its properties

    each

    Execute a function for each matched element

    empty

    Remove all contents from selected elements

    find

    Finds matching children of currently selected element

    first

    Return the first currently selected element

    get

    Returns the PHP DOMNode object for selected elements

    hasClass

    Returns true if a given className exists in any selected element

    html

    Return HTML text of selected elements

    index

    Return a specified element from currently selected elements

    insertAfter

    Insert selected elements after elements specified by xpath argument

    insertBefore

    Insert selected elements before elements specified by xpath argument

    parent

    Returns parents of selected elements

    prepend

    Insert XML at the beginning of selected elements

    remove

    Remove matching elements

    removeAttr

    Removes the specified attribute from all selected elements

    removeClass

    Removes the specified class from all selected elements

    replaceAll

    Replace all selected elements with nodes matching the xpath argument

    replaceWith

    Replace all selected elements with XML argument

    text

    Get or set the text of selected nodes

    toggleClass

    Toggles the presence of a named class in selected elements

    val

    Get or set the "value" of a selected element

    wrap

    Wrap selected elements in the specified XML

    wrapInner

    Wrap each child node of currently selected elements in the specified XML

    xml

    Return XML text of selected elements

    xpath

    Select elements described by xpath argument