關於query Javascript CSS Selector engine

來源:互聯網
上載者:User

query是一個javascript css selector engine,小巧而功能強大,壓縮後2k左右,可以很輕鬆的整合到代碼當中。
支援瀏覽器

IE6+、Firefox、Chrome、Safari、Opera

選取器
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();

下載:http://tanwei-cc.github.com/query/
https://github.com/tanwei-cc/query

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.