2017-01-13 2 views

답변

2

설정하여 HTML의 기본 값 :

<select id="myList"> 
    <option id="foo">option 1</option> 
    <option id="bar" selected="selected">option 2</option> 
</select> 

이 그런 다음 요소에 select2를 호출 그것을 초기화 :

$('#myList').select2();

또는

$('#myList').select2("val", null);