I want to add a new line each time the enter key is pressed. But delegation is not setup properly... Can someone make the simple change to this code? Thanks.`
Asked
Active
Viewed 58 times
0
-
where is the code? – atomankion Mar 17 '22 at 04:52
-
https://jsfiddle.net/want5zv9/ – Mike Mar 17 '22 at 05:06
-
Sorry... I forgot how difficult stackoverflow is to use... – Mike Mar 17 '22 at 05:07
-
`$(".myInput").on('keypress', ...` -> `$(document).on("keypress", ".myInput", ...` – freedomn-m Mar 17 '22 at 05:59
-
For future reference, you can [edit] the question to add your code. Please do read the [tour] and [ask] pages. In this case, the linked question/answer should provide more details. – freedomn-m Mar 17 '22 at 06:00
1 Answers
0
dynamic content will not bind event you can try this:
$('tbody').on('keypress', '.myInput', function(){
});

databorker
- 51
- 1