title: Output content of a text file on a web page
body: <p>I have an <b>offline</b> html file that contains documentation and I have to output content of text file (in my case it is source code).  Is there a way to include content of this file to html page, using only client-side feature (HTML itself or JS)?</p>
  
  <h2>Index.html</h2>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
      &lt;style&gt;
      p.source_code
      {
          font-family:"Courier New"
      }
      &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;p&gt;
              Some content
          &lt;/p&gt;
          &lt;p class="source_code"&gt;
              &lt;!-- place for output content of file main.cpp --&gt;
          &lt;/p&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <h2>main.cpp</h2>
  
  <pre><code>#include &lt;stdio.h&gt;
      int main()
      {
          printf("Hello World");
      }
  </code></pre>
  
  <p>I want my page in browser looks like</p>
  
  <pre><code>    Some content
  
      #include &lt;stdio.h&gt;
      int main()
      {
          printf("Hello World");
      }
  </code></pre>