Function that wraps a DOM element as an ElementWrapper; additional functions are attached as properties.
a DOM element, or a string id of a DOM element.
the ElementWrapper, or null if no element with the id exists.
Returns a wrapped version of the document.body element. Because all Tapestry JavaScript occurs
inside a block at the end of the document, inside the <body> element, it is assumed that
it is always safe to get the body.
Creates a new element, detached from the DOM.
{string} name of element to create, if ommitted, then "div"
Optionalattributes: object{object} attributes to apply to the created element (may be omitted)
Optionalbody: AddableContent{AddableContent} content for the new element, may be omitted for no body
Returns the URL of a component event based on its name and an optional element or null if the event information is not found. When the element isn't passed or it's null, the event data is taken from the
element.name of the component event.
Optionalelement: HTMLElement(object) HTML DOM element to be used as the beginning of the event data search. Optional.
Used to add an event handler to an element (possibly from elements below it in the hierarchy).
CSS selector used to select elements to attach handler to; alternately, a single DOM element, or an array of DOM elements. The document is considered an element for these purposes.
one or more event names, separated by spaces
optional: CSS expression used as a filter; only events that bubble up to a selected element from an originating element that matches the CSS expression will invoke the handler.
function invoked; the function is passed an EventWrapper object, and the context (this)
is the ElementWrapper for the matched element.
onDocument() is used to add an event handler to the document object; this is used for global (or default) handlers.
one or more event names, separated by spaces
optional: CSS expression used as a filter; only events that bubble up to a selected element from an originating element that matches the CSS expression will invoke the handler.
function invoked; the function is passed an EventWrapper object, and the context (this)
is the ElementWrapper for the matched element.
a function of no parameters that removes any added handlers.
Sets up a scanner callback; this is used to perfom one-time setup of elements that match a particular CSS selector. The callback is passed each element that matches the selector. The callback is expected to modify the element so that it does not match future selections caused by zone updates, typically by removing the CSS class or data- attribute referenced by the selector.
a CSS selector.
the function to be called.
Function that wraps a DOM element as an ElementWrapper; additional functions are attached as properties.
a DOM element, or a string id of a DOM element.
the ElementWrapper, or null if no element with the id exists.
Defines the type of the exported object for t5/core/dom.js implementations.