Query is a javascript css selector engine that is compact and powerful. It is compressed for about 2 K and can be easily integrated into the code.
Support for browsers
IE6 +, Firefox, Chrome, Safari, and Opera
Selector
Query (selector [, context])
Div
# Intro
Div # intro
. Red
Span. red
[Name]
[Name = keywords]
Input [name]
Input [name = keywords]
Input [name = 'keyword']
Input [name = "keywords"]
Input [name * = key]
Label [class ~ = Red]
# Nav> li
# Nav> li
# Nav> li
# Nav> li
# Nav li
# Intro,. red, div
Input [name], # nav> li
NATIVE METHOD
Query. getById (id)
Query. getByName (name)
Query. getByTagName (tagName [, parent])
Query. getByClass (className [, parent] [, tagName])
Example:
Query. getByClass ("red ");
Query. getByAttr (name, val [, parent] [, tagName])
Example:
Query. getByAttr ("name", "keywords", parent, "input ");
Query. extend
Example:
Query. extend ({
GetByCity: function (){...}
});
Var city = query. getByCity ();
Download: http://tanwei-cc.github.com/query/
Https://github.com/tanwei-cc/query