gpt4 book ai didi

jquery - 更改事件不会推迟到焦点丢失为止

转载 作者:行者123 更新时间:2023-12-01 03:21:31 24 4
gpt4 key购买 nike

根据JQuery API ,文本字段的 change 仅在焦点丢失时触发:

For select boxes, checkboxes, and radio buttons, the event is fired immediately when the user makes a selection with the mouse, but for the other element types the event is deferred until the element loses focus.

是否存在没有此焦点丢失要求的事件?

我希望每当文本字段发生明显变化时都会触发该事件,考虑到它可能发生变化的各种方式(键盘、鼠标复制和粘贴等)

谢谢!

最佳答案

我建议将 input 事件与 keyup 一起绑定(bind)以支持旧版浏览器。

$('input').on('input keyup', function(e) {
// Do stuff
});

关于jquery - 更改事件不会推迟到焦点丢失为止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9418151/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com