1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html>
<head>
    <title>ExtJs</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" type="text/css" href="ExtJs/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css">
        <script type="text/javascript" src="ExtJs/ext-all.js"></script>
        <script type="text/javascript" src="ExtJs/bootstrap.js"></script>
        <script type="text/javascript" src="ExtJs/packages/ext-theme-crisp/build/ext-theme-crisp.js"></script>
 
    <script type="text/javascript">
            Ext.onReady(function(){
        var panel = new Ext.Panel({
          title: 'SAMPLE',
          renderTo: 'sub1',
          width: '300px',
          html: "<div id='div1' property1='pro1' style='height:200px'><div id='01' property1='pro1'>myid is sub3</div><div id='02'>/<div></div>"
        });
        var el = Ext.query("#div1");
        var targetD = Ext.query('div[property1=pro1]');
        if (el.length>0 || targetD.length>0){
          Ext.Msg.alert("notice", "取得了" + el.length + "个DIV的ID为'div1'的节点<br>" + "取得了" + targetD.length + "个类型为div<br>具备属性property1且其值为pro1的节点");
        }
      });
    </script>
</head>
<body>
<div id=sub1></div>
</body>
</html>

  ExtJs之Ext.query

相关文章:

  • 2021-04-06
  • 2021-05-21
  • 2021-07-03
  • 2021-10-27
猜你喜欢
  • 2021-07-06
  • 2021-09-19
  • 2021-08-28
  • 2021-07-13
  • 2021-09-03
  • 2021-07-11
  • 2021-07-29
相关资源
相似解决方案