I have created add button to create input field. Let me show you my code:
$(document).ready(function(){
var scntDiv = $('#add_words');
var wordscount = 1 ;
var i = $('.line').size() + 1;
$('#add').click(function() {
wordscount++;
$('<div class="line">Word is ' + wordscount + '<input type="text" class="input' + wordscount + '" value="' + wordscount + '" /></div>').appendTo(scntDiv);
i++;
return false;
});
<a id="add">Add</a>
<div id="add_words">
<div class="line">Word is 1<input type="text" value="1" /></div>
</div>
I would like to use .keyup() function instead of <a id="add">Add</a>. What can I try next?
something like this below, here is a list of key codes