title: Javascript change currency always choosing first <option> from <select> dropdown list
body: <p>Hi I've been modifying a script that got the data from <code>&lt;span id=&gt;</code> to instead use a <code>&lt;option value=&gt;</code> from a dropdown list and it seems to work except for always choosing the first <code>&lt;option value=&gt;</code> in the list. If i arrange the order of the html list the first currency will be what it converts to onChange.</p>
  
  <p>Here is the script and html</p>
  
  <pre><code>function ChangeCurrency() { $('select').click(function () {
  var cc = $(this).children('option').attr('value').substring(1);
  document.cookie = 'CurrencyId=' + cc + ';path=/';
  var s = location.pathname;
  if (s.length &gt; 3 &amp;&amp; s.substring(3, 4) == '/')
  s = s.substring(3);
  location.pathname = s;
  })};
  
  
  
  &lt;select onchange="ChangeCurrency()"&gt;   
  &lt;option value="c1"&gt;USD&lt;/option&gt;
  &lt;option value="c2"&gt;EUR&lt;/option&gt;
  &lt;option value="c3"&gt;AUD&lt;/option&gt;
  etc...
  &lt;/select&gt;
  </code></pre>
  
  <p>I don't know what I'm doing wrong? How can I get it to actually process a user selected option from the list (and hopefully keep that option displayed so the list doesn't show USD when the currency on the store is changed to AUD for example)</p>
  
  <p>EDIT:</p>
  
  <p>I need to keep how this code gathers data to "build" the cookie, I don't understand enough to know what string it is putting together from the option list to name the cookie but it is important for the store currency to work. This is the code that worked but the list was a div with span id for the option value. It took me a while to get it sort of working using option values rather than span id's except for being stuck on the first option in the list.</p>