Ext.BLANK_IMAGE_URL ="../js/ext/resources/images/default/s.gif"; //填充图片的本地引用
Ext DomQuery 基础
Ext.query("span");//查询整个文档中的span标签
Ext.query("span","foo");//查询整个文档中的span标签和Id为foo的元素
Ext.query("#foo");//查询返回foo div 的一个元素的数组!
Ext.query(".foo");//查询clss name 等于foo 的元素的数组
Ext.query("*");//返回所有的元素
Ext.query("vid p");//返回一个元素的数组包含P 的div
Ext.query("*[class]");//查询存在class属性的元素
Ext.query("*[class=bar]");//查询class=bar的元素
Ext.query(“*[class!=bar]");//查询不等于bar的元素
Ext.query(“*[class^=b]");//得到class 从b字开的元素
Ext.query(“*[class$=r]");//得到class 以r结尾的元素
Ext.query(“*[class*=a]");//这会得到在class中抽出“a”字符的所有元素
// 获取所以红色的元素
Ext.query("*{color=red}"); // [div#bar.foo]
// 获取所有粉红颜色的并且是有红色子元素的元素
Ext.query("*{color=red} *{color=pink}"); // [span.bar]
// 获取所有不是红色文字的元素
Ext.query("*{color!=red}");
//[html, head, script firebug.js, link, body#ext-gen2.ext-gecko,
// script ext-base.js, script ext-core.js, span.bar,
//a www.extjs.com, div#foo.bar, p, span.bar, a test.html#]
// 获取所有颜色属性是从“yel”开始的元素
Ext.query("*{color^=yel}"); // [a www.extjs.com]
// 获取所有颜色属性是以“ow”结束的元素
Ext.query("*{color$=ow}"); // [a www.extjs.com]
Ext DomQuery 基础
最新推荐文章于 2018-01-16 23:50:00 发布