I have a keyup function for multiple text fields. How to call keyup function when someone copies and skips something in a text box?
.on("click blur keyup", ".emotion", function() { //match something });
Switch the keyup event for input , which will be keyup whenever something is entered into the field, even if the text is inserted (both by pressing CTRL + V and the right mouse button). Paste.
keyup
input
CTRL + V
.on('input', '.emotion', function() { // Do your stuff. });
This will do what you want:
$("#editor").on('paste', function(e) { $(e.target).keyup(); }); $("#editor").on('keyup', function(e) { alert('up'); });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="text" id="editor">
Use the paste event. As far as I tested, it works to paste Ctrl + V and right click> Insert Paste.
paste
Source: https://habr.com/ru/post/987503/More articles:zsh shortens the length of the current path - zshDowncasting fast variables and protocols - iosWhy do I get a signature signing error when calling the "orElseThrow ()" method - javaBest way to calculate max sse mask var - c ++Python: summarize the values โโof three-layer dictionaries - pythonGit: Converting a Subdirectory to a Submodule - gitCould not find a suitable version for angular - angularjsLaravel 5 Migration, Invalid default value when integer - phpJavascript regex for tokenize request - javascriptAbsolute bottom position in scrolling div? - htmlAll Articles