title: Echo PHP variable from JavaScript?
body: <p>I have a PHP page with some JavaScript code also, but this JavaScript code below doesn't seem to work, or maybe I'm way off!</p>
  
  <p>I am trying something like this:</p>
  
  <pre><code>  var areaOption=document.getElementById("&lt;?php echo @$_POST['annonsera_name']?&gt;");
    areaOption.selected=true;
  </code></pre>
  
  <p>Also I have tried this, but it only alerts a BLANK alert-box:</p>
  
  <pre><code>    alert (&lt;?php echo $test;?&gt;); // I have tried this with quotes, double-quotes, etc... no luck
  </code></pre>
  
  <p>Am I thinking completely wrong here?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Some PHP code:</p>
  
  <pre><code>    &lt;?php 
          $test = "Hello World!";
      ?&gt;
  </code></pre>