Force an onchange event on a select with pure Javascript

Create an Event object and pass it to the dispatchEvent method of the element:

let my_element = document.getElementById('my_select');
let event = new Event('change');
my_element.dispatchEvent(event);

Leave a Comment

Your email address will not be published. Required fields are marked *