Pass PHP variable to Javascript code
<p>I obtained a value in PHP and wanna use it in javascript.</p>

<p>Is there any way to do so ??</p>

<p>Here is the code i am using which is not working</p>

<pre><code>$var = "abc"; 

document.getElementById(&lt;?php echo $act;?&gt;).class="active";
</code></pre>

<p>I am using <code>echo $var</code> inside the <code>getElementById</code> method..</p>
