Query is a JavaScript CSS selector engine, compact and powerful, compressed around 2k, can be easily integrated into the code.
Support Browser
ie6+, Firefox, Chrome, Safari, Opera
Selector
Query (Selector[,context])
Div
#intro
Div#intro
. Red
Span.red
[Name]
[Name=keywords]
Input[name]
Input[name=keywords]
Input[name= ' keywords ']
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