<asp:DropDownList ID="ddl" runat="server">
<asp:ListItem Value="1" Text="1"></asp:ListItem>
<asp:ListItem Value="2" Text="2"></asp:ListItem>
<asp:ListItem Value="3" Text="3"></asp:ListItem>
<asp:ListItem Value="4" Text="4" Enabled="false"></asp:ListItem>
</asp:DropDownList>通过jquery怎么让第四个不显示?急、急、急、急、急、急
<asp:ListItem Value="1" Text="1"></asp:ListItem>
<asp:ListItem Value="2" Text="2"></asp:ListItem>
<asp:ListItem Value="3" Text="3"></asp:ListItem>
<asp:ListItem Value="4" Text="4" Enabled="false"></asp:ListItem>
</asp:DropDownList>通过jquery怎么让第四个不显示?急、急、急、急、急、急
function remove()
{
var obj=document.getElementById("option1");
obj.options.add(new Option("ddd",1));//添加新项
var index = 0;
obj.remove(index);//删除指定索引处的项
}
{
var obj=document.getElementById("option1");
obj.options.add(new Option("ddd",1));//添加新项
var index = 0;
obj.remove(index);//删除指定索引处的项
}
这个option1是什么?
if (i == 3) {
//alert(this);
$(this).remove();
}
})
这个有添加的方法吗?
$(function(){
var temp;
$("#btnHide").click(function(){
temp = $("#op4");
$("#op4").remove();
})
$("#btnShow").click(function(){
$("#ddl").append(temp);
})
})
</script>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="ddl" runat="server">
<asp:ListItem Value="1" Text="1"></asp:ListItem>
<asp:ListItem Value="2" Text="2"></asp:ListItem>
<asp:ListItem Value="3" Text="3"></asp:ListItem>
<asp:ListItem Value="4" ID="op4" Text="4" Enabled="true"></asp:ListItem>
</asp:DropDownList>
<input type="button" value="隐藏" id="btnHide" />
<input type="button" value="显示" id="btnShow" />
</div>
</form>
</body>
</html>
看吧 这个可以就给分吧别讨论了 这个没什么讨论的
还在此建议CSDN处理一下不结贴数达到什么条件就不能发帖的功能
让这些贪便宜的人少折腾人