cycling jQuery_Succinctly | Page 29

This is considered implicit iteration because jQuery code assumes you would like to manipulate all three elements, which requires iterating over the elements selected and setting the text node value of each
with the text "I am a div." When this is done by default, it is referred to as implicit iteration. This is pretty handy. For the most part, the majority of the jQuery methods will apply implicit iteration. However, other methods will only apply to the first element in the wrapper set. For example, the jQuery method attr() will only access the first element in the wrapper set when used to get an attribute value. Notes: When using the attr() method to set an attribute, jQuery will actually apply implicit iteration to set the attribute and its value to all the elements in the wrapper set. In the code below, the wrapper set contains all
elements in the page, but the attr() method only returns the id value of the first element contained in the wrapper set. Sample: sample17.html
I am a div
I am a div
I am a div
29