简体   繁体   中英

Select Bootstrap Search Event

i have a bit problem with a select search of bootstrap, i need get the value of the search.

 <div class="form-group has-feedback has-feedback-left">
        <select class="form-control bootstrap-select" data-live-search="true" asp-for="Client" asp-items=@ViewBag.clients></select>
 </div>

i'm trying to get into a change event, but only can get the id and the value of the option, but not of the search value...

$("#Client").change(function () {
     alert(this.value);
});

You can get the search value in live-search textbox by this:

$("#Client").change(function () {
    alert($(".bs-searchbox").find("input").val());
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM