You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changing selected value of a <select> with Javascript does not change the visual selection.
I am using Javascript to change a selected value of a <select>, getting the select element by id and setting it's value to a different option value.
This works just fine, but the visual selection in the select input-field does not change. Clicking afterwards on it, shows the new selected value and will then display it correctly in the input-field.
Is it possible to change the visual selection, if the selected value changes programmatically? For my usecase, I need to show the change of the selection immediately.
On 24 Mar 2021, at 7:56 pm, Witzler ***@***.***> wrote:
Problem
Changing selected value of a <select> with Javascript does not change the visual selection.
I am using Javascript to change a selected value of a <select>, getting the select element by id and setting it's value to a different option value.
This works just fine, but the visual selection in the select input-field does not change. Clicking afterwards on it, shows the new selected value and will then display it correctly in the input-field.
Is it possible to change the visual selection, if the selected value changes programmatically? For my usecase, I need to show the change of the selection immediately.
Reconstruction:
CodePen
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Problem
Changing selected value of a
<select>
with Javascript does not change the visual selection.I am using Javascript to change a selected value of a
<select>
, getting the select element by id and setting it's value to a different option value.This works just fine, but the visual selection in the select input-field does not change. Clicking afterwards on it, shows the new selected value and will then display it correctly in the input-field.
Is it possible to change the visual selection, if the selected value changes programmatically? For my usecase, I need to show the change of the selection immediately.
Reconstruction:
CodePen
The text was updated successfully, but these errors were encountered: