输入事件对于输入标签(输入标签位于 summornote 编辑器中)无法正常工作

问题描述 投票:0回答:1

enter image description here
这是 Summernote 和 summmernote 编辑器输入,但是当我在输入标记中插入值然后调用输入事件来填充输入值属性时,现在我的问题是,如果我输入“python”,那么我会得到“pytho”。输入事件时不会调用最后一个字符。
下面是我的代码。

输入类是“standardTextbox”
有谁知道这个问题吗

$('body').on('input', '.standardTextbox', function () {
                var InValue = $(this).val();
                $(this).attr('value', InValue);
            });
javascript jquery summernote
1个回答
0
投票

尝试

onChange
方法,例如

$(document).on('input.change', '.standardTextbox', function() {
    var InValue = $(this).val();
    // Do something with the complete value
});
© www.soinside.com 2019 - 2024. All rights reserved.