How to get output value in textarea not in div ?
Enter a list of comma separated words:<br> <input id=words type=text size=100 value='foo, bar, baz'></input> <br> Output divs: <div id=container></div> <script> (function() { var debounce, input = document.getElementById('words'), output = document.getElementById('container'), update = function() { var words = input.value.trim().split(/,\s*/); while (output.firstChild) output.removeChild(output.firstChild); for (var i = 0; i < words.length; i++) { var div = document.createElement('div'); div.textContent = words[i]; output.appendChild(div); } }; input.addEventListener('input', function() { window.clearTimeout(debounce); debounce = window.setTimeout(update, 150); }, false); update(); })(); </script>