title: Get the selected option id with jQuery
body: <p>I'm trying to use jQuery to make an ajax request based on a selected option.</p>
  
  <p>Is there a simple way to retrieve the selected <strong>option id</strong> (e.g. "id2") using jQuery?</p>
  
  <pre><code>&lt;select id="my_select"&gt;
     &lt;option value="o1" id="id1"&gt;Option1&lt;/option&gt;
     &lt;option value="o2" id="id2"&gt;Option2&lt;/option&gt;
  &lt;/select&gt;
  
  
  $("#my_select").change(function() {
      //do something with the id of the selected option
  });
  </code></pre>