Get the id of an option chosen in a select by a user
<p>I'm tryin to get the id of an option chosen in a select by a user.</p>

<pre><code>$(document).ready(function(){         
    $(".my_select_class").change(function(){
        var d = $(this).find('option:selected').attr('id');
        alert(d);

        return false;       
    });
});
</code></pre>

<p>The id exists cause I display it in my php code but the alert open a white frame without any character, I don't understand why. Maybe because "attr('id')" doesn't work with "find('option:selected')" ?</p>
