title: To Get Some lines from indx.html to another text.html
body: <p>With the help of following code i will get the 100% ok result but if i need to trigger the same as automatic how it is possible.</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
      &lt;html&gt;
        &lt;head&gt;
          &lt;title&gt;reading file&lt;/title&gt;
          &lt;script type="text/javascript"&gt;
  
              var reader = new FileReader();
  
              function readText(that){
  
                  if(that.files &amp;&amp; that.files[0]){
                      var reader = new FileReader();
                      reader.onload = function (e) {
                          var output=e.target.result;
                          //process text to show only lines with "li class="Body-P-P1":
                  output=output.split("\n").filter(/./.test, /\li class="Body-P-P1"/).join("\n");
  
                      document.getElementById('main').innerHTML= output;
                      };//end onload()
                      reader.readAsText(that.files[0]);
                  }//end if html5 filelist support
              }
      &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;input type="file" onchange='readText(this)' /&gt;
          &lt;div id="main"&gt;&lt;/div&gt;
        &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>Kindly let me know the way i run the above code automatically trigger whenever i click on any programe which contain the same code.</p>