Adds the class name to the element.
the class name
this.
Appends new content (Element, ElementWrapper, or HTML markup string) to the body of the element.
the content to be added
this.
Reads or updates an attribute. With one argument, returns the current value of the attribute. With two arguments, updates the attribute's value, and returns the previous value. Setting an attribute to null is the same as removing it.
Alternately, the first attribute can be an object in which case all the keys
and values of the object are applied as attributes, and this ElementWrapper is returned.
the attribute to read or update, or an object of keys and values
Optionalvalue: null | string | number | boolean(optional) the new value for the attribute
Returns true if element is a checkbox and is checked.
true of false
Returns an array of all the immediate child elements of this element, as ElementWrappers.
the children as ElementWrapper[]
Returns this ElementWrapper if it matches the selector; otherwise, returns the first container element (as an ElementWrapper) that matches the selector. Returns null if no container element matches.
a CSS selector
an element wrapper or null.
Gets or sets a CSS property.
name the name of the property.
the value of the property.
this.
Returns true if this element is visible, and all parent elements are also visible, up to the document body.
true or false
Finds all child elements matching the CSS selector, returning them as an array of ElementWrappers.
a CSS selector.
the matching child elements as an array of ElementWrapper instances
Finds the first child element that matches the CSS selector, wrapped as an ElementWrapper. Returns null if not found.
a CSS selector
Finds the first container element that matches the CSS selector, wrapped as an ElementWrapper. Returns null if not found.
a CSS selector
an element wrapper or null. *
Moves the cursor to the field.
Returns true if the element has the indicated class name, false otherwise.
the class name
true of false
Inserts new content (Element, ElementWrapper, or HTML markup string) into the DOM immediately before this ElementWrapper's element.
the content to be added
this.
Inserts new content (Element, ElementWrapper, or HTML markup string) into the DOM immediately before this ElementWrapper's element.
the content to be added
this.
Stores or retrieves meta-data on the element. With one parameter, the current value for the name is returned (or undefined). With two parameters, the meta-data is updated and the previous value returned. For Prototype, the meta data is essentially empty (except, perhaps, for some internal keys used to store event handling information). For jQuery, the meta data may be initialized from data- attributes.
name of meta-data value to store or retrieve
Optionalvalue: null | string | boolean(optional) new value for meta-data
Returns the offset of the object relative to the document. The returned object has
keys top and left'.
Adds an event handler for one or more events.
one or more event names, separated by spaces
optional: CSS expression used as a filter; only events that bubble up to the wrapped 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.
Returns an ElementWrapper for this element's containing element. Returns null if this element has no parent (either because this element is the document object, or because this element is not yet attached to the DOM).
an element wrapper or null.
Prepends new content (Element, ElementWrapper, or HTML markup string) to the body of the element.
the content to be added
this.
Removes the class name from the element.
the class name
this.
Returns the text of the element and its children.
the element's text.
Returns a string describing this object.
a string.
Fires a named event, passing an optional memo object to event handler functions. This must support common native events (exact list TBD), as well as custom events (in Prototype, custom events must have a prefix that ends with a colon).
name of event to trigger on the wrapped Element
Optionalmemo: anyoptional value assocated with the event; available as WrappedeEvent.memo in event handler functions (must be null for native events). The memo, when provided, should be an object; it is an error if it is a string or other non-object type..
true if the event fully executed, or false if the event was canceled.
Updates this element with new content, replacing any old content. The new content may be HTML text, or a DOM element, or an ElementWrapper, or null (to remove the body of the element).
the content to be added
this.
With no parameters, returns the current value of the element (which must be a form control element, such as <input> or
<textarea>). With one parameter, updates the field's value, and returns the previous value. The underlying
foundation is responsible for mapping this correctly based on the type of control element.
TODO: Define behavior for multi-named elements, such as <select>.
OptionalnewValue: null | string(optional) new value for field
Returns true if this element is visible, false otherwise. This does not check to see if all containers of the element are visible.
true or false
Wraps a DOM element, providing some common behaviors. Exposes the DOM element as property
element.