An example of doing it yourself:
The code is as follows:
<div id= "BD" > <asp:dropdownlist id= "ddlcontent" runat= "Server" clientidmode= "Static" > <as P:listitem selected= "True" > Xuzhou </asp:ListItem> <asp:ListItem> huaian </asp:ListItem> &L t;asp:listitem> Yancheng </asp:ListItem> </asp:DropDownList> <asp:button id= "Btnclick" runat= "serv ER "text=" click I "clientidmode=" Static "/> </div>
jquery Code:
<script src= "Scripts/jquery-1.4.1.min.js" type= "Text/javascript" ></script> <script type= "Text/javascript" language= "JavaScript" > $ (document). Ready (function () { $ ("#btnClick"). Bind ("click", function () { var text1 = $ ("#ddlContent"). Text ();//Popup All values of the binding var text = $ ("#ddlContent"). Find ("option:selected"). Text ();// Pop-up the selected value var val = $ ("#ddlContent"). Val (); alert (Text1); alert (text); alert (Val); }); }); </script>
The value that pops up when the button is clicked:
The pop-up text () is:
The popup Val () is:
jquery Gets the difference between text () and Val ()