On select change, get data attribute value
<p>The following code returns 'undefined'...</p>

<pre><code>$('select').change(function(){
    alert($(this).data('id'));
});

&lt;select&gt;
    &lt;option data-id="1"&gt;one&lt;/option&gt;
    &lt;option data-id="2"&gt;two&lt;/option&gt;
    &lt;option data-id="3"&gt;three&lt;/option&gt;
&lt;/select&gt;
</code></pre>
