Skip to content

Commit c5a906f

Browse files
committed
addclass: Fix error in expected outcome of an example.
Closes #273
1 parent 783cd0d commit c5a906f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

entries/addClass.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
<pre><code>$("p").removeClass("myClass noClass").addClass("yourClass");</code></pre>
2323
<p>Here, the <code>myClass</code> and <code>noClass</code> classes are removed from all paragraphs, while <code>yourClass</code> is added.</p>
2424
<p>As of jQuery 1.4, the <code>.addClass()</code> method's argument can receive a function.</p>
25-
<pre><code>$("ul li:last").addClass(function(index) {
25+
<pre><code>$("ul li").addClass(function(index) {
2626
return "item-" + index;
2727
});</code></pre>
28-
<p>Given an unordered list with five <code>&lt;li&gt;</code> elements, this example adds the class "item-4" to the last <code>&lt;li&gt;</code>.</p>
28+
<p>Given an unordered list with two <code>&lt;li&gt;</code> elements, this example adds the class "item-0" to the first <code>&lt;li&gt;</code> and "item-1" to the second.</p>
2929
</longdesc>
3030
<example>
3131
<desc>Add the class "selected" to the matched elements.</desc>

0 commit comments

Comments
 (0)