javascript
selectbox value set 대신 selectedIndex 사용
관절분리
2016. 1. 27. 18:28
반응형
일부 ie 에서 value set 에러남 그래서 index를 설정함
jQuery("#selection"+i).val(rst[i]);
대신
var elCountry = document.getElementById("selection"+i);
var options = elCountry.options;
for (var j = 0; j < options.length; j++) {
if (options[j].value == rst[i]) {
elCountry.selectedIndex = j;
}
}
반응형