/ Published in: JavaScript
Sets the current element of a dropdown to the default option.
Afrikaans
English
Afrikaans
English
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
resetDropdown : function() { var dropdown = this.getElementById('languageSelector'); for (var i = dropdown.length-1; i >= 0; i--) { if (dropdown.options[i].defaultSelected) { dropdown.selectedIndex = i; break; } } }