* This method makes it easy to retrieve a property value
* from the first matched element.
*
+ * If the element does not have an attribute with such a
+ * name, undefined is returned.
+ *
* @example $("img").attr("src");
* @before <img src="test.jpg"/>
* @result test.jpg
/**
* Set a single property to a value, on all matched elements.
*
- * Can compute values provided as ${formula}, see second example.
- *
* Note that you can't set the name property of input elements in IE.
* Use $(html) or .append(html) or .html(html) to create elements
* on the fly including the name property.
* @result <img src="test.jpg"/>
* @desc Sets src attribute to all images.
*
- * @example $("img").attr("title", "${this.src}");
- * @before <img src="test.jpg" />
- * @result <img src="test.jpg" title="test.jpg" />
- * @desc Sets title attribute from src attribute, a shortcut for attr(String,Function)
- *
* @name attr
* @type jQuery
* @param String key The name of the property to set.
/**
* Set a single property to a computed value, on all matched elements.
*
- * Instead of a value, a function is provided, that computes the value.
+ * Instead of supplying a string value as described
+ * [[DOM/Attributes#attr.28_key.2C_value_.29|above]],
+ * a function is provided that computes the value.
*
* @example $("img").attr("title", function() { return this.src });
* @before <img src="test.jpg" />
},
/**
- * End the most recent 'destructive' operation, reverting the list of matched elements
- * back to its previous state. After an end operation, the list of matched elements will
- * revert to the last state of matched elements.
+ * Revert the most recent 'destructive' operation, changing the set of matched elements
+ * to its previous state (right before the destructive operation).
*
* If there was no destructive operation before, an empty set is returned.
*
+ * A 'destructive' operation is any operation that changes the set of
+ * matched jQuery elements. These functions are: <code>add</code>,
+ * <code>children</code>, <code>clone</code>, <code>filter</code>,
+ * <code>find</code>, <code>not</code>, <code>next</code>,
+ * <code>parent</code>, <code>parents</code>, <code>prev</code> and <code>siblings</code>.
+ *
* @example $("p").find("span").end();
* @before <p><span>Hello</span>, how are you?</p>
* @result [ <p>...</p> ]
* of matched elements. This method is used to remove one or more
* elements from a jQuery object.
*
+ * Please note: the expression cannot use a reference to the
+ * element name. See the two examples below.
+ *
+ * This will not work: $(".res img").not("img[@src$=on]")
+ *
+ * This will: $(".res img").not("[@src$=on]"); // also could be written $(".res img:not([@src$=on])")
+ *
* @example $("p").not( $("div p.selected") )
* @before <div><p>Hello</p><p class="selected">Hello Again</p></div>
* @result [ <p>Hello</p> ]
* to the set of matched elements.
*
* @example $("p").add("span")
- * @before <p>Hello</p><span>Hello Again</span>
- * @result [ <p>Hello</p>, <span>Hello Again</span> ]
+ * @before (HTML) <p>Hello</p><span>Hello Again</span>
+ * @result (jQuery object matching 2 elements) [ <p>Hello</p>, <span>Hello Again</span> ]
+ * @desc Compare the above result to the result of <code>$('p')</code>,
+ * which would just result in <code><nowiki>[ <p>Hello</p> ]</nowiki></code>.
+ * Using add(), matched elements of <code>$('span')</code> are simply
+ * added to the returned jQuery-object.
*
* @name add
* @type jQuery
},
/**
- * Get the current value of the first matched element.
+ * Get the content of the value attribute of the first matched element.
+ *
+ * Use caution when relying on this function to check the value of
+ * multiple-select elements and checkboxes in a form. While it will
+ * still work as intended, it may not accurately represent the value
+ * the server will receive because these elements may send an array
+ * of values. For more robust handling of field values, see the
+ * [http://www.malsup.com/jquery/form/#fields fieldValue function of the Form Plugin].
*
* @example $("input").val();
* @before <input type="text" value="some text"/>
*/
/**
- * Set the value of every matched element.
+ * Set the value attribute of every matched element.
*
* @example $("input").val("test");
* @before <input type="text" value="some text"/>
},
/**
- * A generic iterator function, which can be used to seemlessly
+ * A generic iterator function, which can be used to seamlessly
* iterate over both objects and arrays. This function is not the same
* as $().each() - which is used to iterate, exclusively, over a jQuery
* object. This function can be used to iterate over anything.
* Get a set of elements containing the unique parents of the matched
* set of elements.
*
- * Can be filtered with an optional expressions.
+ * You may use an optional expression to filter the set of parent elements that will match.
*
* @example $("p").parent()
* @before <div><p>Hello</p><p>Hello</p></div>
* Get a set of elements containing the unique ancestors of the matched
* set of elements (except for the root element).
*
- * Can be filtered with an optional expressions.
+ * The matched elements can be filtered with an optional expression.
*
* @example $("span").parents()
* @before <html><body><div><p><span>Hello</span></p><span>Hello Again</span></div></body></html>
* Get a set of elements containing the unique next siblings of each of the
* matched set of elements.
*
- * It only returns the very next sibling, not all next siblings.
+ * It only returns the very next sibling for each element, not all
+ * next siblings.
*
- * Can be filtered with an optional expressions.
+ * You may provide an optional expression to filter the match.
*
* @example $("p").next()
* @before <p>Hello</p><p>Hello Again</p><div><span>And Again</span></div>
* Get a set of elements containing the unique previous siblings of each of the
* matched set of elements.
*
- * Can be filtered with an optional expressions.
+ * Use an optional expression to filter the matched set.
*
- * It only returns the immediately previous sibling, not all previous siblings.
+ * Only the immediately previous sibling is returned, not all previous siblings.
*
* @example $("p").prev()
* @before <p>Hello</p><div><span>Hello Again</span></div><p>And Again</p>
* Get a set of elements containing all of the unique children of each of the
* matched set of elements.
*
- * Can be filtered with an optional expressions.
+ * This set can be filtered with an optional expression that will cause
+ * only elements matching the selector to be collected.
*
* @example $("div").children()
* @before <p>Hello</p><div><span>Hello Again</span></div><p>And Again</p>
*/
/**
- * Set the CSS width of every matched element. If no explicit unit
+ * Set the CSS height of every matched element. If no explicit unit
* was specified (like 'em' or '%') then "px" is added to the width.
*
* @example $("p").height(20);