Hello, I have:
<select id="country" onchange="updateHtml(this.value);"></select>
populated by options (country list) using Protype:
for (var i = 0; i < j.length; ++i) {
var opt = new Element('option', {value:j[i].country})
opt.innerHTML = j[i].country_name;
country.appendChild(opt);
}
now i need to make option to be selected by value, somethhing like
function selectByValue(countryCode) {
// make option selected where option value == countryCode
}
how to do it with Prototype?
Thanks.