How to pass my php variables to javascript
<p>I have a dynamic dropdown. That populates the second drop down. My javascript is not taking my variables when I change my selection when I tested with one php variable. Am new to this</p>

<p>Javascript:</p>

<pre><code>&lt;script type="text/javascript"&gt;
function populate(s1,s2){
var s1 = document.getElementById(s1);
var s2 = document.getElementById(s2);
s2.innerHTML = "";
if(s1.value=="&lt;?php echo $car; ?&gt;"){
var optionArray=[" ","camero Camaro","convette Convette"];
} else
if(s1.value=="Dodge"){
var optionArray=[" ","avanger Avanger","challenger Challenger"];
} else if(s1.value=="Ford"){
var optionArray=[" ","mustang Mustang","fiesta Fiesta"];
}
for (var option in optionArray){
var pair = optionArray[option].split(" ");
var newOption = document.createElement("option");
newOption.value = pair[0];
newOption.innerHTML = pair[1];
s2.options.add(newOption);
}
}
&lt;/script&gt;
</code></pre>

<p>PHP file:</p>

<pre><code>&lt;select name="slct1" id="slct1" onchange="populate(this.id,'slct2')"&gt;

&lt;option value=""&gt;&lt;/option&gt;
&lt;option value="&lt;?php $car = 'Chevy';echo $car; ?&gt;"&gt;Chevy&lt;/option&gt;
&lt;option value="Dodge"&gt;Dodge&lt;/option&gt;
&lt;option value="Ford"&gt;Ford&lt;/option&gt;
&lt;/select&gt;
&lt;hr /&gt;
&lt;select id="slct2" name="slct2"&gt;
&lt;/select&gt;
&lt;hr /&gt;
</code></pre>
