<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>理解Ext.DomQuery</title> <link rel="stylesheet" href="src/ext/resources/css/ext-all.css"> <!--ext-base 必须在ext-all之前引入--> <script src="src/ext/ext-base.js"></script> <script src="src/ext/ext-all.js"></script> <!--<script src="src/ext/ext-lang-zh_CN.js"></script>--> <style> .red{ color: red; } </style> </head> <body> <div id="elId"> <ul> <li>a - one</li> <li>a - two</li> <li>a - three</li> <li>a - four</li> </ul> <ul> <li>b - one</li> <li>b - two</li> <li>b - three</li> <li>b - four</li> </ul> </div> <script> Ext.onReady(function () { Ext.fly('elId').select('li:nth-child(2n)').addClass('red') }); </script> </body> </html>
更多属性方法请查看官方文档API
附带个人收集的Ext3.4书籍:
内含《JavaScript凌厉开发—Ext JS 3详解与实践》,《ExtJs 3.3 中文API.chm》,《ExtJS源码分析与开发实例宝典》,《轻松搞定ExtJS》,《深入浅出ExtJS(第2版)》
提取码:aosf