Send php variable into javascript <pre><code>&lt;input type="button" name="Next" id="Next" value="Next" onclick="showNextQuest(&lt;?php echo $_POST ['$qtnid']; ?&gt;)" /&gt; </code></pre> <p>$qtnid is the name of a radio button, i used the post method to know which one among the radio buttons is selected. The radio button has the same name with different values.It return an undefined error when itried to use alert function inside the showNextQuest function in the javascript. plz help me out.</p>