We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 43dd3a3 commit 8e375e8Copy full SHA for 8e375e8
1 file changed
script.js
@@ -126,13 +126,7 @@ document.addEventListener("DOMContentLoaded", function () {
126
if (matchedValue) {
127
dropdown.value = matchedValue;
128
129
- // ✅ NEW: also set selectedIndex properly
130
- for (let i = 0; i < dropdown.options.length; i++) {
131
- if (dropdown.options[i].value === matchedValue) {
132
- dropdown.selectedIndex = i;
133
- break;
134
- }
135
+ dropdown.selectedIndex = [...dropdown.options].findIndex(opt => opt.value === matchedValue);
136
}
137
138
0 commit comments