title: jQuery - Run a function on change in dropdown
body: <p>I have a dropdown, and I want to run a jQuery function when-ever a differnet item is selected. This is my current script:</p>
  
  <pre><code>&lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
  
  &lt;script&gt;
  $('select[name=dropdown]').change(function() {
      $('#result').html($(this).val());
  });
  &lt;/script&gt;
  
  &lt;div id='result'&gt;&lt;/div&gt;
  
  &lt;select name="dropdown"&gt;
      &lt;option value="1"&gt;option 1&lt;/option&gt;
      &lt;option value="2"&gt;option 2&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>How do i get this to work?</p>