title: JQuery: Change value of hidden input field
body: <p>I'm having a hella time setting the value of a hidden input.  </p>
  
  <p>I want to pass the HTML from between the option tags to the hidden field- end run it will the page title from wordpress' <code>wp_list_dropdowns()</code>.  I've got it returning the text just fine, and on my change event it correctly adds some css (obviously unneeded on a hidden field, but I was trying to determine where things are breaking down). Works if I change the hidden input to a text input. I've seen in several places on SO that this is possible, (changing the value of a hidden input that is), but something is holding me up now and I can't see the answer.</p>
  
  <p>Here's the <a href="http://jsfiddle.net/S9mUL/1/" rel="noreferrer">JSFiddle</a>:</p>
  
  <p>JavaScript:</p>
  
  <pre><code>$(".selector").change(function() {
      var $value = $(this).val();
      var $title = $(this).children('option[value='+$value+']').html();
      alert($title); 
      $('input#bacon').val($title).css('border','3px solid blue');
  });
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;select class="selector" name="testselect"&gt;
      &lt;option value="1"&gt;One&lt;/option&gt;
      &lt;option value="2"&gt;Two&lt;/option&gt;
      &lt;option value="3"&gt;Three&lt;/option&gt;
  &lt;/select&gt;
  &lt;/h3&gt;
  
  &lt;input id="bacon" type="hidden" class="bacon" value="" name="testinput"&gt;
  </code></pre>