2016-03-21 4 views

答えて

1

ここでは、実際の例があります。 Select2の初期化に同じ要素を使用しますか?

$("#myField").select2(); 
 
$("#myField").select2("open");
.select2 { 
 
    width:50% 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<link href="https://cdn.jsdelivr.net/select2/4.0.2/css/select2.min.css" rel="stylesheet" /> 
 
<script src="https://cdn.jsdelivr.net/select2/4.0.2/js/select2.full.js"></script> 
 

 
<select class="form-control select2" id="myField" name="myField" autocomplete="off"> 
 
</select>

関連する問題