Home >Web Front-end >JS Tutorial >关于query Javascript CSS Selector engine_jquery
query is a javascript css selector engine, small and powerful. It is about 2k compressed and can be easily integrated into the code.
Browser support
IE6, Firefox, Chrome, Safari, Opera
Selector
query(selector[,context])
div
#intro
div#intro
.red
span.red
[name]
[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])
query.getByClass("red");
query.getByAttr(name, val[, parent][, tagName])
Example:
query.getByAttr("name", "keywords",parent,"input"); getByCity:function(){...}
});
var city=query.getByCity();
Download:
http://tanwei-cc.github.com/query/
https://github .com/tanwei-cc/query