JQuery - Android - The 'Keyup' Event Does Not Work On Backspace In Chrome

心已入冬 提交于 2019-12-10 17:15:17

问题


I am wondering why the backspace/ delete button does not detect a keyup event in jQuery.

I find this odd as it is useful and should be supported. Are there any alternatives to this?

This is only happening in Android - Chrome.


回答1:


You can actually fix this by attaching an event listener to the input.

var inputBox = document.getElementById('inputId');

inputBox.addEventListener(‘input’, function() {
    exampleFunc();
}, false);

Cheers



来源:https://stackoverflow.com/questions/24557402/jquery-android-the-keyup-event-does-not-work-on-backspace-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!