0

当我尝试同时$('option').hide()使用 selectmenu jquery 插件从 select() 中删除或隐藏一个选项时,它仍然会显示我想要删除的那些选项。销毁选择菜单后,我将看到通常的 html 下拉选择,并且已删除选项。我究竟做错了什么?

4

1 回答 1

2

假设您想更改或删除一个选项。

您可以尝试使用演示页面 http://jquery-ui.googlecode.com/svn/branches/labs/selectmenu/index.html 通过 Firebug 控制台或任何类似的:

$("select#speedC").find("option:first").remove();
//and then you can refresh with 
$("select#speedC") 
.selectmenu("destroy") //destroy the custom select menu 
.selectmenu({style:'dropdown'}); //replace with the new custom select menu 

这不是最好的选择,但刷新似乎不起作用。

让我知道。多纳托。

于 2012-04-20T14:28:29.733 回答