Skip to content

Commit

Permalink
add multiple contexts to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
subtleGradient committed Feb 14, 2010
1 parent 8e0cd51 commit c461306
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Expand Up @@ -29,27 +29,28 @@ Usage
Search this context for any nodes that match this selector.

Expects:
* context: document or node
* context: document or node or array of documents or nodes
* selector: String or SelectorObject
* (**optional**) append: Array or Object with a push method

Returns: append argument or Array of 0 or more nodes

Slick.search(document, "#foo > bar.baz") → [<bar>, <bar>, <bar>]
Slick.search([<ol>, <ul>], "li > a") → [<a>, <a>, <a>]
Slick.search(document, "#foo > bar.baz", { push:function(){} }) → { push:function(){}, 0:<bar>, 1:<bar>, 2:<bar> }


### `find` first in context with selector or null
Find the first node in document that matches selector or null if none are found.

Expects:
* context: document or node
* context: document or node or array of documents or nodes
* selector: String or SelectorObject

Returns: Element or null

Slick.find(document, "#foo > bar.baz") → <bar>
Slick.find(document, "#does-not-exist") → null
Slick.find(node, "#does-not-exist") → null


### node `match` selector?
Expand Down

0 comments on commit c461306

Please sign in to comment.