I'm the gatekeeper of my own destiny

导航

jquery常用操作方法

 

代码
 1  1 操作下拉列表
 2  2 
 3  3 添加选项列表
 4  4 
 5  5 $(this).get(0).options.add(new Option(text,value));
 6  6 
 7  7 清空列表
 8  8 
 9  9 $(this).get(0).options.length=0;
10 10 
11 11 删除指定索引的选项
12 12 
13 13 $(this).get(0).remove(index);
14 14 
15 15 设定需要选中项的值
16 16 
17 17 $(this).get(0).value=value;
18 18 
19 19  获取当前选中选项的文本
20 20 
21 21 $(this).get(0).options[index].text;  
22 22 
23 23 批量修改CSS
24 24 
25 25  $(this).css({left:"35px",top:"24px"})
26 26 
27 27 使指定区域内的元素不可使用(变灰)
28 28 
29 29 $(this).find(*).each(function(){$(this).attr("disabled",true)});
30 30 
31 31  
32 32 
33  
34 
35  
36 

 

 

posted on 2010-01-26 11:41  Wishbay  阅读(249)  评论(0编辑  收藏  举报