Skip to content Skip to sidebar Skip to footer

Which 'event' Should I Use With An Element On An Ios/android?

I need to show/hide results when a user starts to type in the search field of an input element. Some interesting events I can use would be mousedown / mouseup touchstart / touch

Solution 1:

It seems like it really depends on what you want the exact behavior to be. If you want to trigger an action when the user first engages with the field, then you'd want to trigger based on:

touchstart
mousedown
focus

If you want to trigger only when content is changed in the field, you can respond to:

input

If you also want to support IE before IE9 (which doesn't support the input event, then you may also want to trigger based on:

keyup
drop

Post a Comment for "Which 'event' Should I Use With An Element On An Ios/android?"