Passing a JavaScript variable to a html <select> attribute
<p>I am trying to pass a variable from JavaScript to value attribute of the select tag. Here is my code:</p>

<pre><code>&lt;script&gt;

 if (window.location.href.substring(0, 9) === "http://ww") {
     var home_var = "bing.com";
     var home_var = "poem.com";
 } else if (window.location.href.substring(0, 9) === "https://p") {
     var home_var = "https://px.multiscreensite.com/index.php?url=bing.com";
     var poem_var = "https://px.multiscreensite.com/index.php?url=poem.com";
 } else {
     var home_var = "1";
     var_poem_var = "2";
 }
 console.log(home_var);

&lt;/script&gt;

&lt;select OnChange="window.location.href=this.value"&gt;
   &lt;option&gt;Tagged Stuff and Navigation&lt;/option&gt;
   &lt;option value=HOME_VAR&gt;Home Page&lt;/option&gt;
&lt;/select&gt;
</code></pre>