/documentation/appframework/$.query.md
Markdown | 48 lines | 27 code | 21 blank | 0 comment | 0 complexity | 21486c0377a929b8afc3d1ce96207073 MD5 | raw file
- #$.query(selector,[context])
- ```
- $.query - a faster alertnative to $("div");
- ```
- ##Example
- ```
- $.query(".panel");
- ```
- ##Parameters
- ```
- selector String
- [context] Object
- ```
- ##Returns
- ```
- Object Returns an appframework object
- ```
- ##Detail
- $.query(selector,[context]) is faster then using $() to find an element using a query selector.
- $() has a lot of logic to handle finding elements, turning arrays/objects into a collection, etc.
- $.query lets you jump right to the query selector engine and returns an App Framework collection. You should use this when possible.
- When context is passed in, it must be a DOM node to search within.
- ```
- var divs=$.query("divs");
- var elem=$.query("#main");
- var lis=$.query("li",$("#main").get(0));
- ```