I'm fairly new to javascript and I'm having great trouble making a 'To Do' list in an app I'm developing. At the moment you can type in the text field and click submit which will bring up what you typed along with a checkbox next to it. That's all fine and good, but if I add anything else to do it the previous text and checkbox is overwritten and I can't figure out how add to the list.
Any help would be greatly appreciated!
Html:
Enter What To Do <input id='userInput' size=60>
<button onClick='userSubmit()'>Submit</button>
<BR><P>
<div id='result'></div>
JS:
function userSubmit() {
var UI=document.getElementById('userInput').value;
document.getElementById('result').innerHTML='<input type="checkbox">' + UI;
}