query是一个javascript css selector engine,小巧而功能强大,压缩后2k左右,可以很轻松的集成到代码当中。
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
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();