jQuery 'input' event

后端 未结 8 611
执念已碎
执念已碎 2020-11-22 08:53

I\'ve never heard of an event in jQuery called input till I saw this jsfiddle.

Do you know why it\'s working? Is it an alias for keyup or s

相关标签:
8条回答
  • 2020-11-22 09:22

    Be Careful while using INPUT. This event fires on focus and on blur in IE 11. But it is triggered on change in other browsers.

    https://connect.microsoft.com/IE/feedback/details/810538/ie-11-fires-input-event-on-focus

    0 讨论(0)
  • 2020-11-22 09:26

    Occurs when the text content of an element is changed through the user interface.

    It's not quite an alias for keyup because keyup will fire even if the key does nothing (for example: pressing and then releasing the Control key will trigger a keyup event).

    A good way to think about it is like this: it's an event that triggers whenever the input changes. This includes -- but is not limited to -- pressing keys which modify the input (so, for example, Ctrl by itself will not trigger the event, but Ctrl-V to paste some text will), selecting an auto-completion option, Linux-style middle-click paste, drag-and-drop, and lots of other things.

    See this page and the comments on this answer for more details.

    0 讨论(0)
提交回复
热议问题