title: Javascript add span to li
body: <p>I want my code to instead of creating two texts with my newly created span, i want it to say"Some text x2" and then x3 and so on.</p>
  
  <p>Heres my code</p>
  
  <pre><code> &lt;div&gt;
        &lt;li id="myLi"&gt;
           Some text  (This is where i want my other text to be instead)
        &lt;/li&gt;
  
   &lt;/div&gt;
  
      &lt;td class="add" onmousedown="myFunction()"&gt;Add&lt;/td&gt;
  </code></pre>
  
  <p>When i click the td, it adds to the li but when i click several times it just comes more text. I want it to say "Some text x2" instead.</p>
  
  <pre><code>   function myFunction() {
  var proc = document.createElement("SPAN");
  var t = document.createTextNode("Some new text.");
  proc.appendChild(t);
  document.getElementById("myLi").appendChild(proc);
  }
  </code></pre>
  
  <p>Thanks</p>