title: Add a list item through JavaScript
body: <p>So, I am trying to print out an array that gets user input text added to it, but what I want to print out is an ordered list of the array. As you can see, (if you run my code) the list item just keeps getting the user input added to it, and no new list items are added with people's names.</p>
  <p>Here is the code below:</p>
  <pre><code> &lt;!DOCTYPE html&gt;
   &lt;html&gt;
   &lt;head&gt;
   First name: &lt;input type=&quot;text&quot; id=&quot;firstname&quot;&gt;&lt;br&gt; 
  
   &lt;script type=&quot;text/javascript&quot;&gt;
   var x= [];
  
   function changeText2(){
  var firstname = document.getElementById('firstname').value;
  document.getElementById('boldStuff2').innerHTML = firstname;
  x.push(firstname);
  document.getElementById('demo').innerHTML = x;
   }
   &lt;/script&gt;
  
   &lt;p&gt;Your first name is: &lt;b id='boldStuff2'&gt;&lt;/b&gt; &lt;/p&gt; 
   &lt;p&gt; Other people's names: &lt;/p&gt;
   
   &lt;ol&gt;
       &lt;li id = &quot;demo&quot;&gt; &lt;/li&gt; 
   &lt;/ol&gt;
  
   &lt;input type='button' onclick='changeText2()'   value='Submit'/&gt; 
  
   &lt;/head&gt;
   &lt;body&gt;
   &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>