Adding elements to a page

The first and last of the following commands are only needed once - the ones in the middle relace your current code to create a list instead of a series of paragraphs.

var ol = document.createElement("ol");   

var li = document.createElement('li');
ol.appendChild(li); 
var t = document.createTextNode(UserInput);      
li.appendChild(t); 

document.getElementByID("t").appendChild(ol); 
1 Like