title: Wrap text in a javascript variable
body: <p>I have a text variable and I need to wrap the text:</p>
  <p>My code:</p>
  <pre class="lang-js prettyprint-override"><code>var text = &quot;Test test test test test test&quot;;
                  
              function typing(){
                  if(i&lt;text.length){
                      document.getElementById(&quot;text&quot;).innerHTML += text.charAt(i);
                      i++;
                      setTimeout(typing,50);
                  }
              }
              typing();
  </code></pre>
  <p>How can I wrap this text? I print <code>i</code> with an <code>innerHTML</code>, but I need to wrap the text like <code>br</code> in html.</p>