title: Javascript Automatic changing text animation
body: <p>I am trying to build a website and I need to create a new heading which changes automatically
  like:-</p>
  <pre><code>&quot;H&quot; and then &quot;He&quot; and then &quot;Hel&quot; and then &quot;Hell&quot; and &quot;Hello&quot; and so on...
  </code></pre>
  <p>like an animation type stuff<br />
  my earlier code was:-</p>
  <pre class="lang-js prettyprint-override"><code>let Str = &quot;Hello Guys, Welcome to my website&quot;;
  for (i = 0; i &lt; Str.length; i++) {
    let string = Str[i]
    setTimeout('document.getElementById(&quot;Header&quot;).innerHTML += \'' + string + '\';', 100 * i);
  }
  </code></pre>
  <p>It works but I need to remove that text too <br />
  to add the new text</p>