title: Dynamic JavaScript Image SRC Path Replacement
body: <p>I'm trying to use JS to dynamically replace an image on a page based upon the value of the selected option of a select dropdown. Everything in the code I've included below works perfectly. My "selected_text" variable is properly pulling the value of the selected option in my select dropdown, but I need to somehow write that value to the replacement img src path.</p>
  
  <p>IE: If someone selects "Audi" from my select dropdown, I want to write "Audi" where I have "[selected_text]" in my replacement img src path.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function popmake() {
      var w = document.vafForm.make.selectedIndex;
      var selected_text = document.vafForm.make.options[w].text;
      document.getElementById('make-image').src="/path/to/images/[selected_text].jpg";
  }
  &lt;/script&gt;
  </code></pre>