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 8146351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:58:16+00:00 2026-06-06T13:58:16+00:00

JSFiddle I’ve set up a select with 3 option s (1 blank) in the

  • 0

JSFiddle

I’ve set up a select with 3 options (1 blank) in the fiddle. When I switch from foo to bar manually, the change listener fires normally.

Now if I reset the select through JS with the code posted in some answers here, the change event does not fire for the newly selected blank option, furthermore, if I select the option which was selected before clicking in the reset button the onchange event won’t fire either.

I’m sure the select‘s value is being changed with the function above, which can be seen in this fiddle, but the select‘s onchange event simply doesn’t fire.

I’ve also tried onchange, onclick, oninput events to no avail. Right now I’m wondering if I should use a MutationObserver or remove the rendered chosen element from the DOM and create another, but I’m probably overthinking it. Any help is appreciated.

Also:

This answer helped me a lot: jQuery Chosen reset

This answer didn’t help: how to fire onchange event in chosen prototype javascript select box?

Code for future reference if jsfiddle.net is taken down:

HTML

<div id="wrapper">
    <select id="chosen">
        <option value="!!EMPTY VALUE!!"></option>
        <option value="foo">foo</option>
        <option value="bar">bar</option>
    </select>
</div>
<br>
<button id="reset">Reset</button>

JS

$(function() {
    $('#chosen').chosen();

    $('#wrapper').on('change', '#chosen', function() {
        console.log('onchange: ' + this.value);
    });

    $('#reset').click(function() {
        $("#chosen").val('').trigger("liszt:updated"); //doesn't work
        //$("#chosen").prop('selectedIndex', 0).trigger("liszt:updated"); //doesn't work either
        console.log('reset: ' + $('option:selected').val());
    });
});
  • 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-06-06T13:58:17+00:00Added an answer on June 6, 2026 at 1:58 pm

    You need to trigger the change after you change the value with $(selector).trigger("change")

    $('#reset').click(function() {
            $("#chosen").val('').trigger("change"); //doesn't work
            //$("#chosen").prop('selectedIndex', 0).trigger("liszt:updated");
            console.log('reset: ' + $('option:selected').val());
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://jsfiddle.net/rFEER/ <select id=users> <option value=1>jack</option> <option value=2>brill</option> <option value=3>antony</option> </select>​ js: $(#users).change(function(){ alert($(this).val()); })​
http://jsfiddle.net/FYtJH/1 The filtering select needs to warn users that they're about to change the
JSFiddle URL: http://jsfiddle.net/sFe45/ Code: <html> <head> <title>Foo</title> <script type=text/javascript> var target; var anchor; function
http://jsfiddle.net/fSrBv/ I'm having an issue here where in my From field I'm able to
jsFiddle: http://jsfiddle.net/Mw4j2/6/ Trying to change attributes to a selector if the seconds count is
JSFIDDLE HERE If you look at the js fiddle you will find clicking the
http://jsfiddle.net/9BCrs/5/ I have this set up to load a file into a DIV using
http://jsfiddle.net/fJkBU/1/ That's my code. Basically, I have an iFrame whose source may change. I
http://jsfiddle.net/9BCrs/2/ With respect to the above fiddle how could I use different links in
JsFiddle Link I have two divs overlapping with borders on both. When I set

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.