Skip to content

Commit 5e25f72

Browse files
committed
.addClass(): Trivial cleanup.
1 parent ff88a02 commit 5e25f72

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

entries/addClass.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
<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>
2929
</longdesc>
3030
<example>
31-
<desc>Adds the class "selected" to the matched elements.</desc>
31+
<desc>Add the class "selected" to the matched elements.</desc>
3232
<code><![CDATA[
33-
$("p:last").addClass("selected");
33+
$("p").last().addClass("selected");
3434
]]></code>
3535
<css><![CDATA[
3636
p { margin: 8px; font-size:16px; }
@@ -44,7 +44,7 @@
4444
]]></html>
4545
</example>
4646
<example>
47-
<desc>Adds the classes "selected" and "highlight" to the matched elements.</desc>
47+
<desc>Add the classes "selected" and "highlight" to the matched elements.</desc>
4848
<code><![CDATA[
4949
$("p:last").addClass("selected highlight");
5050
]]></code>
@@ -67,7 +67,7 @@
6767
addedClass = "green";
6868
$("p").text("There is one green div");
6969
}
70-
70+
7171
return addedClass;
7272
});
7373
]]></code>
@@ -89,4 +89,4 @@
8989
<category slug="css"/>
9090
<category slug="version/1.0"/>
9191
<category slug="version/1.4"/>
92-
</entry>
92+
</entry>

0 commit comments

Comments
 (0)