title: How to grab select value with jQuery and pass to another function
body: <p>I'm trying to get the value of a select input when a button is clicked but can't for the life of me get it to work (long week).</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>        &lt;tr&gt;
              &lt;td&gt;
                &lt;%= select_tag :thermal, options_for_select(AdminPrinter.all.map{|ap| [ap.name, ap.ip_address]}) %&gt;&lt;br /&gt;&lt;br /&gt;
                &lt;input id = "thermal-button" type='button' value='Print Thermal Receipt'  /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
  </code></pre>
  
  <p><strong>jQuery</strong> - so far....</p>
  
  <pre><code>$("input#thermal-button").on("click", function(){
    var p = $(this).closest('select');
  
  }); 
  </code></pre>