您现在的位置>>.Net中文社区>>AJAX编程

Jquery 小技巧

浏览量: 作者:佚名 来源:互联网

Jquery的两个小技巧:

获取dropdownlist选中的值

获取radioboxlist选中的值

1.获取dropdownlist选中的值

  1. $('#ddlCustomerType option:selected').val()   
  2.  
  3.  
  4. //html:  
  5.             <asp:DropDownList ID="ddlCustomerType" runat="server" >  
  6.              <asp:ListItem Text="代理商" Value="1"></asp:ListItem>  
  7.             <asp:ListItem Text="加盟店" Value="2"></asp:ListItem>   
  8.             <asp:ListItem Text="公司团体" Value="3"></asp:ListItem>  
  9.             <asp:ListItem Text="电子商务" Value="4"></asp:ListItem>  
  10.         
  11.             </asp:DropDownList> 

2. 获取radioboxlist选中的值

  1. $("input[name='rblType']:checked").val()  
  2.  
  3.                 <asp:RadioButtonList ID="rblType" runat="server" >  
  4.                 <asp:ListItem Text="直客" Value="1" Selected="True"></asp:ListItem>  
  5.                 <asp:ListItem Text="同业" Value="2"></asp:ListItem>  
  6.                 </asp:RadioButtonList> 

 

 

本站部份资源来于互联网,只供学习之用,不得用于商业,如有侵犯版权请联系告知,本站将第一时间删除!
站长QQ:373638128 邮箱:navy1015@126.com
copyright © 2008 .Net中文社区 ASPXCS.NET™.All Rights Reserved 滇ICP备08102132号