jquery 查找select ,并触发事件.

项目中,用jquery 查找select ,并触发事件. 记一笔.关键代码;


                             var count=$("#drpCity option").length;
                             //查找城市
                              for(var i=0;i<count;i++){ 
                                    var vTmp=$("#drpCity").get(0).options[i].value;
                                    if($.trim(vTmp)==vDpoizone){ 
                                         $("#drpCity").get(0).options[i].selected = true; 
                                         $("#drpCity").trigger("change");
                                              break; 
                                         } 
                                    }
                             
                                    
                               }

posted @ 2011-03-30 16:41  youngff  阅读(3548)  评论(0编辑  收藏  举报