Dropdownlist的onchange事件应用


1   function selectDpList(dp) {
2             var sIndex = dp.selectedIndex;//返回选中是第几项 0,1....
3             var sText = dp.options[dp.selectedIndex].text;//返回选中的文本--文本1,文本2 ...
4             var sValue = dp.value;//返回选中的文本--v1,v2 ...
5         }
1   <asp:DropDownList runat="server" CssClass="productType" ID="dp_ProductTag" Width="153px" onchange="JavaScript:selectDpList(this)">
2       <asp:ListItem Text="文本1" Value="1"></asp:ListItem>
3       <asp:ListItem Text="文本2" Value="2"></asp:ListItem>
4       <asp:ListItem Text="文本3" Value="2"></asp:ListItem>
5   </asp:DropDownList>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM