title: How can I change innerHTML with PHP?
body: <p>I want to change the innerHTML with PHP code. But I cannot get it to work, and I do not understand why. I want it to change some text on the page but from another file. And so I thought that I could use this:</p>
  
  <pre><code>document.getElementById ("page"). innerHTML = "&lt;? php echo $ home?&gt;";
  </code></pre>
  
  <p>But it does not work.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;?php
  $home = file_get_contents("home.php");
  ?&gt;
  &lt;script type="text/javascript"&gt;
      function ChangePage(page)
      {
         if(page == "home")
              {
              document.getElementById("page").innerHTML = "&lt;?php echo $home ?";
              }
          }
  &lt;/script&gt;
  </code></pre>