Home >Web Front-end >JS Tutorial >关于query Javascript CSS Selector engine_jquery

关于query Javascript CSS Selector engine_jquery

WBOY
WBOYOriginal
2016-05-16 17:37:131161browse

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])

Example:

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




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn