Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions entries/addClass.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<desc>Adds the specified class(es) to each element in the set of matched elements.</desc>
<longdesc>
<p>It's important to note that this method does not replace a class. It simply adds the class, appending it to any which may already be assigned to the elements.</p>
<p>The <code>.addClass()</code> method manipulates the <code>className</code> <em>property</em> of the selected elements, not the <code>class</code> <em>attribute</em>. Once the property is changed, it's the browser that updates the attribute accordingly. An implication of this behavior is that this method only works for documents with HTML DOM semantics (e.g., not pure XML documents).</p>
<p>More than one class may be added at a time, separated by a space, to the set of matched elements, like so:</p>
<pre><code>
$( "p" ).addClass( "myClass yourClass" );
Expand Down
1 change: 1 addition & 0 deletions entries/removeClass.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<desc>Remove a single class, multiple classes, or all classes from each element in the set of matched elements.</desc>
<longdesc>
<p>If a class name is included as a parameter, then only that class will be removed from the set of matched elements. If no class names are specified in the parameter, all classes will be removed.</p>
<p>The <code>.removeClass()</code> method manipulates the <code>className</code> <em>property</em> of the selected elements, not the <code>class</code> <em>attribute</em>. Once the property is changed, it's the browser that updates the attribute accordingly. This means that when the <code>class</code> attribute is updated and the last class name is removed, the browser may set the attribute's value to an empty string instead of removing the attribute completely. An implication of this behavior is that this method only works for documents with HTML DOM semantics (e.g., not pure XML documents).</p>
<p>More than one class may be removed at a time, separated by a space, from the set of matched elements, like so:</p>
<pre><code>
$( "p" ).removeClass( "myClass yourClass" )
Expand Down