DOM
Provides DOM helper methods
defined in: dom.js
Namespace
Attributes
- DOM. query {HTMLElement[]} <static> Accepts a string containing a CSS selector which is then used to match a set of elements.
Methods
- DOM. addClass (selector, className) <static> Adds the specified class(es) to each of the set of matched elements.
- DOM. addStyleSheet (refWin, cssText, id) <static> Creates a stylesheet from a text blob of rules.
- DOM. appendTo (newNodes, parents, loadScripts) <static> Insert every element in the set of newNodes to the end of every element in the set of parents.
- DOM. attr (selector, name, val, pass) <static> Get the value of an attribute for the first element in the set of matched elements.
- DOM. children (selector, filter) <static> Get the children of the first element in the set of matched elements, optionally filtered by a filter.
- DOM. clone (selector, deep, withDataAndEvent, deepWithDataAndEvent) <static> Create a deep copy of the first of matched elements.
- DOM. closest (selector, filter, context, allowTextNode) <static> Get the first element that matches the filter, beginning at the first element of matched elements and progressing up through the DOM tree.
- DOM. contains (container, contained) <static> Check to see if a DOM node is within another DOM node.
- DOM. contents (selector, filter) <static> Get the childNodes of the first element in the set of matched elements (includes text and comment nodes), optionally filtered by a filter.
- DOM. create (html, props, ownerDoc, _trim) <static> Creates DOM elements on the fly from the provided string of raw HTML.
- DOM. css (selector, name, val) <static> Get the computed value of a style property for the first element in the set of matched elements.
- DOM. data (selector, name, data) <static> If name set and data unset Store arbitrary data associated with the specified element.
- DOM. docHeight (win) <static> Get the height of document
- DOM. docWidth (win) <static> Get the width of document
- DOM. empty (selector) <static> Remove(include data and event handlers) all child nodes of the set of matched elements from the DOM.
- DOM. equals (n1, n2) <static> Check to see if a DOM node is equal with another DOM node.
- DOM. filter (selector, filter, context) <static> Reduce the set of matched elements to those that match the selector or pass the function's test.
- DOM. first (selector, filter, allowTextNode) <static> Get the first child of the first element in the set of matched elements.
- DOM. get (selector, context) <static> Accepts a string containing a CSS selector which is then used to match a set of elements.
- DOM. hasAttr (selector, name) <static> Whether one of the matched elements has specified attribute
- DOM. hasClass (selector, className) <static> Determine whether any of the matched elements are assigned the given classes.
- DOM. hasData (selector, name) <static> Determine whether an element has any data or specified data name associated with it.
- DOM. hasProp (selector, name) <static> Whether one of the matched elements has specified property name
- DOM. height (selector, value) <static> Get the current computed height for the first element in the set of matched elements.
- DOM. hide (selector) <static> Hide the matched elements.
- DOM. html (selector, htmlString, loadScripts, callback) <static> Get the HTML contents of the first element in the set of matched elements.
- DOM. innerHeight (selector) <static> Get the current computed height for the first element in the set of matched elements, including padding but not border.
- DOM. innerWidth (selector) <static> Get the current computed width for the first element in the set of matched elements, including padding but not border.
- DOM. insertAfter (newNodes, refNodes, loadScripts) <static> Insert every element in the set of newNodes after every element in the set of refNodes.
- DOM. insertBefore (newNodes, refNodes, loadScripts) <static> Insert every element in the set of newNodes before every element in the set of refNodes.
- DOM. last (selector, filter, allowTextNode) <static> Get the last child of the first element in the set of matched elements.
- DOM. next (selector, filter, allowTextNode) <static> Get the immediately following sibling of the first element in the set of matched elements.
- DOM. offset (selector, coordinates, relativeWin) <static> Get the current coordinates of the first element in the set of matched elements, relative to the document.
- DOM. outerHeight (selector, includeMargin) <static> Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin.
- DOM. outerHTML (selector, htmlString, loadScripts) <static> Get the outerHTML of the first element in the set of matched elements.
- DOM. outerWidth (selector, includeMargin) <static> Get the current computed width for the first element in the set of matched elements, including padding and border, and optionally margin.
- DOM. parent (selector, filter, context) <static> Get the parent of the first element in the current set of matched elements, optionally filtered by a selector.
- DOM. prependTo (newNodes, parents, loadScripts) <static> Insert every element in the set of newNodes to the beginning of every element in the set of parents.
- DOM. prev (selector, filter, allowTextNode) <static> Get the immediately preceding sibling of the first element in the set of matched elements.
- DOM. prop (selector, name, value) <static> Get the value of a property for the first element in the set of matched elements.
- DOM. remove (selector, keepData) <static> Remove the set of matched elements from the DOM.
- DOM. removeAttr (selector, name) <static> Remove an attribute from each element in the set of matched elements.
- DOM. removeClass (selector, className) <static> Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
- DOM. removeData (selector, name) <static> Remove a previously-stored piece of data from matched elements.
- DOM. removeProp (selector, name) <static> Remove a property for the set of matched elements.
- DOM. replaceClass (selector, oldClassName, newClassName) <static> Replace a class with another class for matched elements.
- DOM. replaceWith (selector, newNodes) <static> Replace each element in the set of matched elements with the provided newNodes.
- DOM. scrollIntoView (selector, container, top, hscroll, auto) <static> Makes the first of matched elements visible in the container
- DOM. scrollLeft (selector, value) <static> Get the current horizontal position of the scroll bar for the first element in the set of matched elements.
- DOM. scrollTop (selector, value) <static> Get the current vertical position of the scroll bar for the first element in the set of matched elements.
- DOM. show (selector) <static> Display the matched elements.
- DOM. siblings (selector, filter, allowTextNode) <static> Get the siblings of the first element in the set of matched elements, optionally filtered by a filter.
- DOM. style (selector, name, val) <static> Get inline style property from the first element of matched elements or Set one or more CSS properties for the set of matched elements.
- DOM. test (selector, filter, context) <static> Returns true if the matched element(s) pass the filter test
- DOM. text (selector, val) <static> Get the combined text contents of each element in the set of matched elements, including their descendants.
- DOM. toggle (selector) <static> Display or hide the matched elements.
- DOM. toggleClass (selector, className, state) <static> Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
- DOM. unique (The) <static> Sorts an array of DOM elements, in place, with the duplicates removed.
- DOM. unselectable (selector) <static> Make matched elements unselectable
- DOM. unwrap (wrappedNodes) <static> Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
- DOM. val (selector, value) <static> Get the current value of the first element in the set of matched elements.
- DOM. viewportHeight (win) <static> Get the height of window
- DOM. viewportWidth (win) <static> Get the width of document
- DOM. width (selector, value) <static> Get the current computed width for the first element in the set of matched elements.
- DOM. wrap (wrappedNodes, wrapperNode) <static> Wrap a node around each element in the set of matched elements
- DOM. wrapAll (wrappedNodes, wrapperNode) <static> Wrap a node around all elements in the set of matched elements
- DOM. wrapInner (wrappedNodes, wrapperNode) <static> Wrap a node around the childNodes of each element in the set of matched elements.
Attributes Detail
-
DOM. query {HTMLElement[]} <static> Accepts a string containing a CSS selector which is then used to match a set of elements.
Defined in:selector.js.
Methods Detail
-
Adds the specified class(es) to each of the set of matched elements.
Defined in:class.js.- Parameters
-
- [ selector ] {HTMLElement|String|HTMLElement[]} matched elements
- className {String} One or more class names to be added to the class attribute of each matched element. multiple class names is separated by space
-
Creates a stylesheet from a text blob of rules. These rules will be wrapped in a STYLE tag and appended to the HEAD of the document.
Defined in:style.js.- Parameters
-
- [ refWin = window ] {window} Window which will accept this stylesheet
- cssText {String} The text containing the css rules
- [ id ] {String} An id to add to the stylesheet for later removal
-
Insert every element in the set of newNodes to the end of every element in the set of parents.
Defined in:insertion.js.- Parameters
-
- newNodes {HTMLElement|HTMLElement[]} Nodes to be inserted
- parents {HTMLElement|HTMLElement[]|String} Nodes to be referred as parentNode
- loadScripts
-
Get the value of an attribute for the first element in the set of matched elements. or Set one or more attributes for the set of matched elements.
Defined in:attr.js.- Parameters
-
- selector {HTMLElement[]|HTMLElement|String|Element} matched elements
- name {String|Object} The name of the attribute to set. or A map of attribute-value pairs to set.
- [ val ] A value to set for the attribute.
- pass
- Returns
-
- {String}
-
Get the children of the first element in the set of matched elements, optionally filtered by a filter.
Defined in:traversal.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ filter ] {String|Function} Selector string or filter function
- Returns
-
- {HTMLElement[]}
-
Create a deep copy of the first of matched elements.
Defined in:create.js.- Parameters
-
- [ selector ] {HTMLElement|String|HTMLElement[]} matched elements
- [ deep = false ] {Boolean|Object} whether perform deep copy or copy config.
- [ deep.deep ] {Boolean} whether perform deep copy
- [ deep.withDataAndEvent = false ] {Boolean} A Boolean indicating whether event handlers and data should be copied along with the elements.
- [ deep.deepWithDataAndEvent = false ] {Boolean} A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. if set true then deep argument must be set true as well.
- [ withDataAndEvent = false ] {Boolean} A Boolean indicating whether event handlers and data should be copied along with the elements.
- [ deepWithDataAndEvent = false ] {Boolean} A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. if set true then deep argument must be set true as well.
- Returns
-
- {HTMLElement}
- See
-
- https://developer.mozilla.org/En/DOM/Node.cloneNode
-
Get the first element that matches the filter, beginning at the first element of matched elements and progressing up through the DOM tree.
Defined in:traversal.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- filter {String|Function} Selector string or filter function
- [ context ] {HTMLElement|String|Document|HTMLElement[]} Search bound element
- allowTextNode
- Returns
-
- {HTMLElement}
-
Check to see if a DOM node is within another DOM node.
Defined in:traversal.js.- Parameters
-
- container {HTMLElement|String|Element} The DOM element that may contain the other element.
- contained {HTMLElement|String|Element} The DOM element that may be contained by the other element.
- Returns
-
- {Boolean}
-
Get the childNodes of the first element in the set of matched elements (includes text and comment nodes), optionally filtered by a filter.
Defined in:traversal.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ filter ] {String|Function} Selector string or filter function
- Returns
-
- {Node[]}
-
Creates DOM elements on the fly from the provided string of raw HTML.
Defined in:create.js.- Parameters
-
- html {String} A string of HTML to create on the fly. Note that this parses HTML, not XML.
- [ props ] {Object} An map of attributes on the newly-created element.
- [ ownerDoc ] {Document} A document in which the new elements will be created
- _trim
- Returns
-
- {DocumentFragment|HTMLElement}
-
Get the computed value of a style property for the first element in the set of matched elements. or Set one or more CSS properties for the set of matched elements.
Defined in:style.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement|Element} 选择器或节点或节点数组
- name {String|Object} A CSS property. or A map of property-value pairs to set.
- [ val ] A value to set for the property.
- Returns
-
- {undefined|String}
-
If name set and data unset Store arbitrary data associated with the specified element. Returns undefined. or If name set and data unset returns value at named data store for the element or If name unset and data unset returns the full data store for the element.
Defined in:data.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ name ] {String} A string naming the piece of data to set.
- [ data ] The new data value.
- Returns
-
- {Object|undefined}
-
Get the height of document
Defined in:offset.js.- Parameters
-
- [ win = window ] {window} Window to be referred.
-
Get the width of document
Defined in:offset.js.- Parameters
-
- [ win = window ] {window} Window to be referred.
-
Remove(include data and event handlers) all child nodes of the set of matched elements from the DOM.
Defined in:create.js.- Parameters
-
- [ selector ] {HTMLElement|String|HTMLElement[]} matched elements
-
Check to see if a DOM node is equal with another DOM node.
Defined in:traversal.js.- Parameters
-
- n1 {HTMLElement|String|Element}
- n2 {HTMLElement|String|Element}
- Returns
-
- {Boolean}
-
Reduce the set of matched elements to those that match the selector or pass the function's test.
Defined in:selector.js.- Parameters
-
- selector {String|HTMLElement[]|NodeList} Matched elements
- filter {String|Function} Selector string or filter function
- [ context ] {String|HTMLElement[]|Document} Context under which to find matched elements
- Returns
-
- {HTMLElement[]}
-
Get the first child of the first element in the set of matched elements. If a filter is provided, it retrieves the next child only if it matches that filter.
Defined in:traversal.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ filter ] {String|Function} Selector string or filter function
- allowTextNode
- Returns
-
- {HTMLElement}
-
Accepts a string containing a CSS selector which is then used to match a set of elements.
Defined in:selector.js.- Parameters
-
- selector {String|HTMLElement[]} A string containing a selector expression. or array of HTMLElements.
- [ context ] {String|HTMLElement[]|Document|HTMLElement|window} context under which to find elements matching selector.
- Returns
-
- {HTMLElement} The first of found HTMLElements
-
Whether one of the matched elements has specified attribute
Defined in:attr.js.- Parameters
-
-
selector
{Array
|String} matched elements - name {String} The attribute to be tested
-
selector
{Array
- Returns
-
- {Boolean}
-
Determine whether any of the matched elements are assigned the given classes.
Defined in:class.js.- Parameters
-
- [ selector ] {HTMLElement|String|HTMLElement[]} matched elements
- className {String} One or more class names to search for. multiple class names is separated by space
- Returns
-
- {Boolean}
-
Determine whether an element has any data or specified data name associated with it.
Defined in:data.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ name ] {String} A string naming the piece of data to set.
- Returns
-
- {Boolean}
-
Whether one of the matched elements has specified property name
Defined in:attr.js.- Parameters
-
-
selector
{Array
|String|HTMLElement} 元素 - name {String} The name of property to test
-
selector
{Array
- Returns
-
- {Boolean}
-
Get the current computed height for the first element in the set of matched elements. or Set the CSS height of each element in the set of matched elements.
Defined in:style.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ value ] {String|Number} An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
- Returns
-
- {Number|undefined}
-
Hide the matched elements.
Defined in:style.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements.
-
Get the HTML contents of the first element in the set of matched elements. or Set the HTML contents of each element in the set of matched elements.
Defined in:create.js.- Parameters
-
- [ selector ] {HTMLElement|String|HTMLElement[]} matched elements
- htmlString {String} A string of HTML to set as the content of each matched element.
- [ loadScripts = false ] {Boolean} True to look for and process scripts
- callback
-
Get the current computed height for the first element in the set of matched elements, including padding but not border.
Defined in:style.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- Returns
-
- {Number}
-
Get the current computed width for the first element in the set of matched elements, including padding but not border.
Defined in:style.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- Returns
-
- {Number}
-
Insert every element in the set of newNodes after every element in the set of refNodes.
Defined in:insertion.js.- Parameters
-
- newNodes {HTMLElement|HTMLElement[]} Nodes to be inserted
- refNodes {HTMLElement|HTMLElement[]|String} Nodes to be referred
- loadScripts
-
Insert every element in the set of newNodes before every element in the set of refNodes.
Defined in:insertion.js.- Parameters
-
- newNodes {HTMLElement|HTMLElement[]} Nodes to be inserted
- refNodes {HTMLElement|HTMLElement[]|String} Nodes to be referred
- loadScripts
-
Get the last child of the first element in the set of matched elements. If a filter is provided, it retrieves the previous child only if it matches that filter.
Defined in:traversal.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ filter ] {String|Function} Selector string or filter function
- allowTextNode
- Returns
-
- {HTMLElement}
-
Get the immediately following sibling of the first element in the set of matched elements. If a filter is provided, it retrieves the next child only if it matches that filter.
Defined in:traversal.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ filter ] {String|Function} Selector string or filter function
- allowTextNode
- Returns
-
- {HTMLElement}
-
Get the current coordinates of the first element in the set of matched elements, relative to the document. or Set the current coordinates of every element in the set of matched elements, relative to the document.
Defined in:offset.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ coordinates ] {Object} An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
- [ coordinates.left ] {Number} the new top and left coordinates for the elements.
- [ coordinates.top ] {Number} the new top and top coordinates for the elements.
- [ relativeWin ] {window} The window to measure relative to. If relativeWin is not in the ancestor frame chain of the element, we measure relative to the top-most window.
- Returns
-
- {Object|undefined} if Get, the format of returned value is same with coordinates.
-
Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin.
Defined in:style.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ includeMargin ] {Boolean} A Boolean indicating whether to include the element's margin in the calculation.
- Returns
-
- {Number}
-
Get the outerHTML of the first element in the set of matched elements. or Set the outerHTML of each element in the set of matched elements.
Defined in:create.js.- Parameters
-
- [ selector ] {HTMLElement|String|HTMLElement[]} matched elements
- htmlString {String} A string of HTML to set as outerHTML of each matched element.
- [ loadScripts = false ] {Boolean} True to look for and process scripts
-
Get the current computed width for the first element in the set of matched elements, including padding and border, and optionally margin.
Defined in:style.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ includeMargin ] {Boolean} A Boolean indicating whether to include the element's margin in the calculation.
- Returns
-
- {Number}
-
Get the parent of the first element in the current set of matched elements, optionally filtered by a selector.
Defined in:traversal.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ filter ] {String|Function} Selector string or filter function
- [ context ] {HTMLElement|String|Document|HTMLElement[]} Search bound element
- Returns
-
- {HTMLElement}
-
Insert every element in the set of newNodes to the beginning of every element in the set of parents.
Defined in:insertion.js.- Parameters
-
- newNodes {HTMLElement|HTMLElement[]} Nodes to be inserted
- parents {HTMLElement|HTMLElement[]|String} Nodes to be referred as parentNode
- loadScripts
-
Get the immediately preceding sibling of the first element in the set of matched elements. If a filter is provided, it retrieves the previous child only if it matches that filter.
Defined in:traversal.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ filter ] {String|Function} Selector string or filter function
- allowTextNode
- Returns
-
- {HTMLElement}
-
Get the value of a property for the first element in the set of matched elements. or Set one or more properties for the set of matched elements.
Defined in:attr.js.- Parameters
-
-
selector
{Array
|String|HTMLElement} matched elements - name {String|Object} The name of the property to set. or A map of property-value pairs to set.
- [ value ] A value to set for the property.
-
selector
{Array
- Returns
-
- {String|undefined|Boolean}
-
Remove the set of matched elements from the DOM.
Defined in:create.js.- Parameters
-
- [ selector ] {HTMLElement|String|HTMLElement[]} matched elements
- [ keepData = false ] {Boolean} whether keep bound events and jQuery data associated with the elements from removed.
-
Remove an attribute from each element in the set of matched elements.
Defined in:attr.js.- Parameters
-
-
selector
{Array
|String} matched elements - name {String} An attribute to remove
-
selector
{Array
-
Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
Defined in:class.js.- Parameters
-
- [ selector ] {HTMLElement|String|HTMLElement[]} matched elements
- className {String} One or more class names to be removed from the class attribute of each matched element. multiple class names is separated by space
-
Remove a previously-stored piece of data from matched elements. or Remove all data from matched elements if name unset.
Defined in:data.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ name ] {String} A string naming the piece of data to delete.
-
Remove a property for the set of matched elements.
Defined in:attr.js.- Parameters
-
-
selector
{Array
|String|HTMLElement} matched elements - name {String} The name of the property to remove.
-
selector
{Array
-
Replace a class with another class for matched elements. If no oldClassName is present, the newClassName is simply added.
Defined in:class.js.- Parameters
-
- [ selector ] {HTMLElement|String|HTMLElement[]} matched elements
- oldClassName {String} One or more class names to be removed from the class attribute of each matched element. multiple class names is separated by space
- newClassName {String} One or more class names to be added to the class attribute of each matched element. multiple class names is separated by space
-
Replace each element in the set of matched elements with the provided newNodes.
Defined in:insertion.js.- Parameters
-
- selector {HTMLElement|HTMLElement[]|String} set of matched elements
- newNodes {HTMLElement|HTMLElement[]|String} new nodes to replace the matched elements
-
Makes the first of matched elements visible in the container
Defined in:offset.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ container = window ] {String|HTMLElement|Document} Container element
- [ top = true ] {Boolean} Whether align with top of container.
- [ hscroll = true ] {Boolean} Whether trigger horizontal scroll.
- [ auto = false ] {Boolean} Whether adjust element automatically (only scrollIntoView when element is out of view)
- See
-
- http://www.w3.org/TR/2009/WD-html5-20090423/editing.html#scrollIntoView http://www.sencha.com/deploy/dev/docs/source/Element.scroll-more.html#scrollIntoView http://yiminghe.javaeye.com/blog/390732
-
Get the current horizontal position of the scroll bar for the first element in the set of matched elements. or Set the current horizontal position of the scroll bar for each of the set of matched elements.
Defined in:offset.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement|window} matched elements
- value {Number} An integer indicating the new position to set the scroll bar to.
-
Get the current vertical position of the scroll bar for the first element in the set of matched elements. or Set the current vertical position of the scroll bar for each of the set of matched elements.
Defined in:offset.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement|window} matched elements
- value {Number} An integer indicating the new position to set the scroll bar to.
-
Display the matched elements.
Defined in:style.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements.
-
Get the siblings of the first element in the set of matched elements, optionally filtered by a filter.
Defined in:traversal.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ filter ] {String|Function} Selector string or filter function
- allowTextNode
- Returns
-
- {HTMLElement[]}
-
Get inline style property from the first element of matched elements or Set one or more CSS properties for the set of matched elements.
Defined in:style.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- name {String|Object} A CSS property. or A map of property-value pairs to set.
- [ val ] A value to set for the property.
- Returns
-
- {undefined|String}
-
Returns true if the matched element(s) pass the filter test
Defined in:selector.js.- Parameters
-
- selector {String|HTMLElement[]} Matched elements
- filter {String|Function} Selector string or filter function
- [ context ] {String|HTMLElement[]|Document} Context under which to find matched elements
- Returns
-
- {Boolean}
-
Get the combined text contents of each element in the set of matched elements, including their descendants. or Set the content of each element in the set of matched elements to the specified text.
Defined in:attr.js.- Parameters
-
- selector {HTMLElement[]|HTMLElement|String} matched elements
- [ val ] {String} A string of text to set as the content of each matched element.
- Returns
-
- {String|undefined}
-
Display or hide the matched elements.
Defined in:style.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements.
-
Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
Defined in:class.js.- Parameters
-
- [ selector ] {HTMLElement|String|HTMLElement[]} matched elements
- className {String} One or more class names to be added to the class attribute of each matched element. multiple class names is separated by space
- [ state ] {Boolean} optional boolean to indicate whether class should be added or removed regardless of current state.
-
Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers.
Defined in:selector.js.- Parameters
-
- The {HTMLElement[]} Array of DOM elements.
- Returns
-
- {HTMLElement[]}
-
Make matched elements unselectable
Defined in:style.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements.
-
Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
Defined in:insertion.js.- Parameters
-
- wrappedNodes {HTMLElement|HTMLElement[]|String} set of matched elements
-
Get the current value of the first element in the set of matched elements. or Set the value of each element in the set of matched elements.
Defined in:attr.js.- Parameters
-
-
selector
{Array
|String} matched elements -
[
value
]
{String|Array
} A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked.
-
selector
{Array
- Returns
-
-
{undefined|String|Array
|Number}
-
{undefined|String|Array
-
Get the height of window
Defined in:offset.js.- Parameters
-
- [ win = window ] {window} Window to be referred.
-
Get the width of document
Defined in:offset.js.- Parameters
-
- [ win = window ] {window} Window to be referred.
-
Get the current computed width for the first element in the set of matched elements. or Set the CSS width of each element in the set of matched elements.
Defined in:style.js.- Parameters
-
- selector {HTMLElement[]|String|HTMLElement} Matched elements
- [ value ] {String|Number} An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
- Returns
-
- {Number|undefined}
-
Wrap a node around each element in the set of matched elements
Defined in:insertion.js.- Parameters
-
- wrappedNodes {HTMLElement|HTMLElement[]|String} set of matched elements
- wrapperNode {HTMLElement|String} html node or selector to get the node wrapper
-
Wrap a node around all elements in the set of matched elements
Defined in:insertion.js.- Parameters
-
- wrappedNodes {HTMLElement|HTMLElement[]|String} set of matched elements
- wrapperNode {HTMLElement|String} html node or selector to get the node wrapper
-
Wrap a node around the childNodes of each element in the set of matched elements.
Defined in:insertion.js.- Parameters
-
- wrappedNodes {HTMLElement|HTMLElement[]|String} set of matched elements
- wrapperNode {HTMLElement|String} html node or selector to get the node wrapper
Classes
- Anim
- Anim.Easing
- Attribute
- Base
- Button
- ComboBox
- ComboBox.LocalDataSource
- ComboBox.RemoteDataSource
- Component
- Component.Container
- Component.Controller
- Component.Manager
- Component.Render
- Component.UIBase
- Component.UIBase.Align
- Component.UIBase.Box
- Component.UIBase.Close
- Component.UIBase.Constrain
- Component.UIBase.ContentBox
- Component.UIBase.Drag
- Component.UIBase.Loading
- Component.UIBase.Mask
- Component.UIBase.Position
- Component.UIBase.Resize
- Component.UIBase.StdMod
- Cookie
- DataLazyload
- DD
- DD.Constrain
- DD.DDM
- DD.Draggable
- DD.DraggableDelegate
- DD.Droppable
- DD.DroppableDelegate
- DD.Proxy
- DD.Scroll
- DOM
- Editor
- Editor.Range
- Editor.Utils
- Editor.Walker
- Event
- Event.Object
- Event.Target
- IO
- IO.XhrObject
- KISSY
- KISSY.Defer
- KISSY.Loader
- KISSY.Loader.Module
- KISSY.Loader.Package
- KISSY.Promise
- Menu
- Menu.FilterMenu
- Menu.Item
- Menu.PopupMenu
- Menu.Separator
- MenuButton
- MenuButton.Option
- MenuButton.Select
- MVC
- MVC.Collection
- MVC.Model
- MVC.Router
- MVC.View
- NodeList
- Overlay
- Overlay.Dialog
- Overlay.Popup
- Resizable
- Tree
- Tree.CheckNode
- Tree.CheckTree
- Tree.Node
- Waterfall
- Waterfall.Loader