I'm making a JS application that automatically another textbox on user input. I'm not however sure how I append an input
to a li
The end result I want to get at is this:
<ul id="lst">
<li>Item1: <input type="text"></li>
<li>Item2: <input type="text"></li>
<!-- more li added on button press -->
</ul>
what I got so far is this:
var onClick = function() {
var ul = document.getElementById('lst'),
li = document.createElement('li');
li.appendChild(document.createTextNode('Item' + counter + ': '));
counter++;
ul.appendChild(li);
}
How do I also append the <input type="text">
node?