title: Output the content of a .txt file line by line
body: <p>I've created a program where the user uploads a .txt file.
  Now I want to create a button where I click on it and the it shows the content of the .txt file **line by line with a little delay between **</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>document.getElementById('inputfile')
    .addEventListener('change', function() {
  
      var fr = new FileReader();
      fr.onload = function() {
        document.getElementById('output')
          .textContent = fr.result;
      }
  
      fr.readAsText(this.files[0]);
    })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input type="file" name="inputfile" id="inputfile"&gt;
  &lt;br&gt;
  &lt;pre id="output"&gt;&lt;/pre&gt;</code></pre>
  </div>
  </div>
  </p>