question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to remove all options?

See original GitHub issue

Dear all, If I have a multiselect like:

<select id='pre-selected-options' multiple='multiple'> <option value='elem_1'>elem 1</option> <option value='elem_2'>elem 2</option> <option value='elem_3'>elem 3</option> <option value='elem_4'>elem 4</option> </select>

$('#pre-selected-options').multiSelect();

I wanna remove all options in #pre-selected-options. How can I do it?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:10

github_iconTop GitHub Comments

7reactions
TiedtTechcommented, Jun 6, 2017

View this post https://github.com/lou/multi-select/issues/193

$('#my-multi').empty().multiSelect('refresh');

0reactions
Samirdatainflowcommented, Sep 25, 2021

View this post #193

$('#my-multi').empty().multiSelect('refresh');

Thank you so much, it work properly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do you remove all the options of a select box and then ...
First clear all exisiting option execpt the first one(--Select--) · Append new option values using loop one by one $('#ddlCustomer').find('option ...
Read more >
jQuery: Remove all the options of a select box and then add ...
jQuery Practical Exercises with Solution: Remove all the options of a select box and then add one option and select it with jQuery....
Read more >
Remove all options from a drop-down with JavaScript and ...
This post will discuss how to remove all options from a drop-down list with JavaScript and jQuery... jQuery has .remove() method for removing...
Read more >
How to remove all the options of a select box and then add ...
We select all the options in the select box using the find() method with a parameter of “option“. Then, we remove all the...
Read more >
How to remove all options within a Html select box using JQuery
How to remove all options within a Html select box using JQuery ... $('#selectBox').empty().append('<option>New Option</option>');. This will add ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found