Because the change
event requires an actual browser event initiated by the user instead of via javascript code.
Do this instead:
$("#single").val("Single2").trigger('change');
or
$("#single").val("Single2").change();
More Related Contents:
- jQuery Adding new option to select element doesn't pick up the string [closed]
- Use jQuery to change a second select list based on the first select list option
- jQuery – auto size text input (not textarea!) [duplicate]
- Find all unchecked checkboxes in jQuery
- Get index of selected option with jQuery
- Force a checkbox to always submit, even when unchecked
- Disable select options based on value *through the HTML only!*
- Use jQuery to hide a DIV when the user clicks outside of it
- jQuery get value of select onChange
- How can I simulate an anchor click via jquery?
- jQuery removeClass wildcard
- HTML5 Canvas 100% Width Height of Viewport?
- Selecting elements with special characters in the ID
- jQuery .html() vs .append()
- jQuery split long ul list in smaller lists
- jQuery select change show/hide div event
- Get the value of -webkit-transform of an element with jquery
- Auto-click button element on page load using jQuery
- jQuery autocomplete for dynamically created inputs
- jQuery get selected option value (not the text, but the attribute ‘value’)
- jQuery checkbox event handling
- Draggable div without jQuery UI
- How to force an HTML form to validate without submitting it via jQuery
- jQuery change placeholder text color
- Jquery Multiple load in a DIV
- What’s faster for including scripts, using CDN (Google) or storing them locally in website’s root?
- Selectable optgroup using select2
- Html5 drag and drop on svg element
- change the href of a css link via jquery
- Can jQuery selectors be used with DOM mutation observers?