jquery遍历select

js:
${BindComplaintType}
  ${BindReReason}
  function select(sltName,value){
   $("select[@name="+sltName+"] option").each(function(){
   if($(this).val() == value){
   $(this).attr("selected","selected");
   }
   });
  }

后台.cs
string strJS = "select('select','" + h["ComplaintType"].ToString() + "');";
mVh.Put("BindComplaintType", strJS);
string strJS1 = "select('select2','" + h["ReReason"].ToString() + "');";
mVh.Put("BindReReason", strJS1);//Return Reason
posted @ 2009-11-05 16:58  Silver.Lee  阅读(9432)  评论(1编辑  收藏  举报