jQuery: keyup event for mobile device

后端 未结 4 1906
小鲜肉
小鲜肉 2020-11-28 14:30

I\'m having a few issues getting a keyup event to fire on my iPhone, my code is as follows:

        var passwordArray = [\"word\", \"test\", \"hello\", \"ano         


        
4条回答
  •  粉色の甜心
    2020-11-28 15:09

    The touchend event is fired when a touch point is removed from the device.

    https://developer.mozilla.org/en-US/docs/Web/Events/touchend

    You can pass keyup and touchend events into the .on() jQuery method (instead of the keyup() method) to trigger your code on both of these events.

    test.on('keyup touchend', function(){
    //code
    });
    

提交回复
热议问题