Workaround 1. Encapsulate the actions that generate tags and add events into Method 2. Add Event 3 to the label. The most important point is to generate the tag and add the current JS return monitor $ (". Out:last"). focus (); var i = 0; var myfun = function () { i++; var keyCode = event.keycode; if (keyCode == ") { var html = "<span ><input type= ' text ' class= ' out ' value= ' " + i + " ' /></span > "; if ($ (". Out:last "). Val (). Trim () != "") { $ (". Out:last"). Removeclass ("Out"). attr ("Disabled", "disabled"). Parent (). After (HTML); $ (". Out:last"). Focus (); $ (". Out"). KeyDown (Myfun); } else { alert ("Please enter a label"); } } };
$ (". Out"). KeyDown (Myfun);
The above is for reference only, there is a better solution please provide.
JS Keyboard Event Monitor Enter, and then disable the current input edit, create the input, but the following code can only be monitored once, the second cannot be monitored.