Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6089197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:04:21+00:00 2026-05-23T12:04:21+00:00

If I have select with id=select_test, how to delete all options inside but select

  • 0

If I have select with id=”select_test”, how to delete all options inside but select stay on page, so I can load again some new options ? ( I get answer how to load, but I cannot empty, I tried like $('#select_test').empty();

and

$('#select_test').find('option').remove();

but it doesn’t work ). Can someone say what I did wrong ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:04:22+00:00Added an answer on May 23, 2026 at 12:04 pm

    It should work. Look at this fiddle.
    Or try this code:

    $("#emptySelect").click(function() {
      $('#select_test').empty();
    });
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    
    <select id="select_test" multiple="multiple">
      <option>Low</option>
      <option>Medium</option>
      <option>High</option>
    </select>
    
    <input type="button" id="emptySelect" value="empty options" />
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table. In this table have select element. How can I find
Probably a stupid question but so far I can't figure this out... I have
I have 3 columns(id,parent,value) with some data and this query: SELECT * FROM test
I have a form on my page which contains two select dropdowns. The first
I have a simple webpage that adds & deletes options from a select element
I have a oracle database. I use the OracleDataAdapter(Oracle.DataAccess.dll) for select, update, insert, delete
Using C# how can I select all the text in a textbox when I
I have this query: SELECT * FROM sample INNER JOIN test ON sample.sample_number =
I have the following test-code: CREATE TABLE #Foo (Foo int) INSERT INTO #Foo SELECT
i have following filteringselect: <select name=v dojoType=dijit.form.FilteringSelect valueList=v id=v value=0><option value=></option><option value=0>0-test</option><option value=1>1-test2/option><option value=2>2-test3</option><option

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.