[英]Keyup event in select2 searchbox
I can't seem to find a keyup event for the searchbox in select2.我似乎无法在 select2 中找到搜索框的 keyup 事件。 I've tried this:我试过这个:
$('select2.search__field').on("keyup", function ()
{
...
});
and alot of stuff, but nothing works.和很多东西,但没有任何效果。
You can catch key events like : 您可以捕获以下关键事件:
Try this code: 试试这个代码:
$(document).on('keyup',
'.select2-search__field',
function (e) {
alert($(this).val());
}
);
Try this.尝试这个。 It worked for me.它对我有用。
$('.items-input').on('keyup', '.select2-search__field', function (e) {
//your code
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.