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();
});

デタッチオプションを再度追加するにはどうすればよいですか?事前にThx...

4

1 に答える 1

1

選択したオプションへの参照を取得し、その参照を使用してそれらを切り離すか、他のことを行うことができます。

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

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