티스토리 뷰

select option들 중에 원하는 option에 selected 속성을 넣어주는 방법 입니다.


var target = document.getElementById('selectList');   //대상 셀렉트 id

target.options[idx].selected = true;   //options에 대상 option의 index를 넣으시면 됩니다.