Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated readme

  • Loading branch information...
commit 82e22c75aa04b46ef3512c8cf6638816e0e56c3a 1 parent bb3f980
@kylebarrow authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 README.md
View
6 README.md
@@ -236,12 +236,12 @@ p {display:none}
</html>
```
-#### $(selector).cls(*classes*,*replace/add/remove/toggle/has*)
+#### $(selector).cls(*class*,*replace/add/remove/toggle/has*)
*Gets or optionally sets the class for a selector.*
**cls** with no arguments will return either a class string (only one matching DOM element found) or array of class strings (more than one matching DOM element found).
-If only the *classes* argument is specified, the default action is to replace any DOM element class with this class. If the *has* action is specified, Chibi returns true if the selector includes the *classes*.
+If only the *class* argument is specified, the default action is to replace any DOM element class with this class. If the *has* action is specified, Chibi returns true if the selector includes the *class*.
```html
<!DOCTYPE html>
@@ -259,7 +259,7 @@ If only the *classes* argument is specified, the default action is to replace an
<p class="mono">Bar</p>
<script>
$('p').cls(); // returns classes set on all paragraph elements, as there is more than one paragraph element, an array ['', 'mono']
- $('p').cls('mono','has'); // returns true if the paragraph element includes the classes, as there is more than one paragraph element, an array [false, true]
+ $('p').cls('mono','has'); // returns true if the paragraph element includes the 'mono' class, as there is more than one paragraph element, an array [false, true]
$('p').cls('mono','toggle'); // toggles the mono class on all paragraph elements
$('p').cls('red bold'); // sets the class to "red" and "bold" to all paragraph elements, replacing any existing classes
$('p').cls('red bold','replace'); // also sets the class to "red" and "bold" to all paragraph elements, replacing any existing classes
Please sign in to comment.
Something went wrong with that request. Please try again.