0

我需要有关以下代码的帮助:http: //jsfiddle.net/8PsdE/

<SELECT ID="pizzasize" NAME="pizzasize">
<OPTION VALUE="s">small
<OPTION VALUE="m">medium
<OPTION VALUE="l">large
</SELECT>

    $(function() {
   $('#pizzasize > option[value*="m"]').detach();
});

如何再次添加分离的选项?提前谢谢...

4

1 回答 1

1

获取对您选择的选项的引用,然后您可以使用该引用分离它们或对它们执行任何其他操作:

$(function() {
  var theOptions = $('#pizzasize > option[value*="m"]');
  theOptions.detach();

  // Do other things with theOptions
});
于 2010-07-03T09:25:53.640 回答