Bro*_*mer 0 jquery jquery-select2
我想从select2输入中获取当前搜索项值(即使它不匹配).
<div class="select2-container select2-container-multi form-control" id="s2id_author">
<ul class="select2-choices">
<li class="select2-search-field">
<label for="s2id_autogen1" class="select2-offscreen"></label>
<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="select2-input" id="s2id_autogen1" placeholder="" style="width: 34px;" aria-activedescendant="select2-result-label-2">
</li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
这个在4.0+以上为我工作
var nome = $("#select2_id").data('select2').$dropdown.find("input").val();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5652 次 |
| 最近记录: |