大佬教程收集整理的这篇文章主要介绍了这个jquery验证码有什么问题?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<script type="text/javascript"> $(document).ready(function () { $('#ddlMajor').change(function () { if ($(this).val() == 'Other') { // $('#txtOther').show(); $('#txtOther').css('display','inline'); } else { // $('#txtOther').hide(); $('#txtOther').css('display','block'); } }); }); </script> <asp:TextBox runat="server" ID="txtOther" style="display:none;" > </asp:TextBox> <asp:DropDownList runat="server" ID="ddlMajor"> <asp:ListItem Value="AccounTing">AccounTing</asp:ListItem> <asp:ListItem Value="Management">Management</asp:ListItem> <asp:ListItem Value="Other">Other</asp:ListItem> </asp:DropDownList>
<asp:TextBox runat="server" ID="txtOther" style="display:none;" CssClass="txtOther"> </asp:TextBox> <asp:DropDownList runat="server" ID="ddlMajor" CssClass="ddlMajor"> <asp:ListItem Value="AccounTing">AccounTing</asp:ListItem> <asp:ListItem Value="Management">Management</asp:ListItem> <asp:ListItem Value="Other">Other</asp:ListItem> </asp:DropDownList> $('.ddlMajor').change(function () { ... });
$(document).ready(function () { $('.ddlMajor').change(function () { if ($(this).val() == 'Other') { $('.txtOther').css('display','block'); } else { $('.txtOther').css('display','none'); } });
或者,如果您不想更改标记,请使用ClientID.注意:这只有在.aspx文件中包含javascript时才有效
$(document).ready(function () { $('#<%= ddlMajor.ClientID %>').change(function () { if ($(this).val() == 'Other') { $('#<%= txtOther.ClientID %>').css('display','block'); } else { $('#<%= txtOther.ClientID %>').css('display','none'); } });
以上是大佬教程为你收集整理的这个jquery验证码有什么问题?全部内容,希望文章能够帮你解决这个jquery验证码有什么问题?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。