リセットボタンをクリックしてjquery multi selectedから選択した項目を削除するには?Refresh Jquery multi selectedを選択
<select data-placeholder="Select" id="options" class="chosen-select" maxwidth="50px" multiple tabindex="15" ></select>
私は運を持ついくつかの方法を試してみました。これは私のコードです:
$("#options").multiselect('refresh');
$("#options").multiselect('clearSelection');
$('#options').multiSelect('deselect_all');
$("#options").find('option:selected').removeAttr("selected");
上記まだ任意の助けをいただければ幸いです
、画像のように選択した項目を表示した後。
そのスクリーンショットはマルチセレクトのようには見えません。 https://harvesthq.github.io/chosen/)またはtagit(http://aehlke.github.io/tag-it/)...使用しているライブラリについて100%確信していますか?編集:実際にクラスに基づいて、それは選択されたフィールドです... '.chosen()'メソッドを使うか、またはプロパティをfalseに設定します(つまり '$("#options "))。 .prop( 'selected'、false) ')、単に属性を削除するのではなく、 '$("#options ")。trigger( 'selected:updated');' –