Skip to content

Commit

Permalink
doc: Merge/update old Element.Methods.match docs into source [prototy…
Browse files Browse the repository at this point in the history
…pejs#85 state:fixed_in_branch]
  • Loading branch information
dandean authored and samleb committed Jan 12, 2010
1 parent 21f707d commit cb27017
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/dom/dom.js
Expand Up @@ -732,6 +732,28 @@ Element.Methods = {
* - selector (String): A CSS selector.
*
* Checks if `element` matches the given CSS selector.
*
* ##### Examples
*
* <ul id="fruits">
* <li id="apples">
* <ul>
* <li id="golden-delicious">Golden Delicious</li>
* <li id="mutsu" class="yummy">Mutsu</li>
* <li id="mcintosh" class="yummy">McIntosh</li>
* <li id="ida-red">Ida Red</li>
* </ul>
* </li>
* </ul>
*
* $('fruits').match('ul');
* // -> true
*
* $('mcintosh').match('li#mcintosh.yummy');
* // -> true
*
* $('fruits').match('p');
* // -> false
**/
match: function(element, selector) {
element = $(element);
Expand Down

0 comments on commit cb27017

Please sign in to comment.