title: Javascript: Passing data via an option element and "onchange"
body: <p>I have a "select" element which is being populated by a PHP file.  The output is a list of locations with names, addresses, cities, states, etc.  I'd like to make it so when this dropdown is changed the new address is loaded into the address form.</p>
  
  <p>Here is the code I'd like to get working, which might explain this better:</p>
  
  <pre><code>&lt;select name='address' id='address'&gt;
      &lt;option value='0' onselect='clearAddress()'&gt;&lt;/option&gt;
      &lt;option value='1' onselect='loadAddress("1 Main St", "New York")'&gt;Mark's House&lt;/option&gt;
      &lt;option value='2' onselect='loadAddress("5 Arc Rd", "Orlando")'&gt;Bob's Apt&lt;/option&gt;
      &lt;option value='3' onselect='loadAddress("2 Fox Ln", "Clinton")'&gt;Joe's Bar&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I know onselect doesn't work here, and while adding "onchange" to the select element might work, I can't see how it would function for individual options.</p>
  
  <p>Any thoughts on how to do this?  Thanks!</p>