$("#myDropdown").val("0"); // specify your default item value
Quote: JavaScript var temp = "a"; var mySelect = document.getElementById('mySelect'); for(var i, j = 0; i = mySelect.options[j]; j++) { if(i.value == temp) { mySelect.selectedIndex = j; break; } }
var temp = "a"; var mySelect = document.getElementById('mySelect'); for(var i, j = 0; i = mySelect.options[j]; j++) { if(i.value == temp) { mySelect.selectedIndex = j; break; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)