Consider a web page that has a select menu with a JavaScript event handler tied to the menu\'s onchange event that when fired reloads the page with a new query string (using the
Here is a vanilla JS version of @Mitch's answer.
let selects = document.getElementsByTagName('select');
for (let i = 0; i < selects.length; ++i) {
let currentSelect = selects[i];
let selectedOption = currentSelect.querySelector('option[selected]');
if (selectedOption) currentSelect.value = selectedOption.value;
}
Here is the performance comparison