title: How to read the first line of .txt file?
body: <p>can anyone one help how to read the first line of .txt file? I have input type file that upload example.txt then I would like to grab the first line from that code. I tried something like this:</p>
  
  <pre><code>&lt;input type="file" id="fileUpload" name="fileUpload"/&gt; MyTest.txt //file name
  
  function confirmFileSubmit(){
      var fileName = $('#fileUpload').val();
      alert($('#fileUpload').split('\n')[0]);
  } 
  </code></pre>
  
  <p>After I run my code this just outputted file name in alert box. I'm not sure how I can read the content of the file. If anyone can help please let me know.</p>