Get Select ID onchange Jquery
<p>In my application i am trying to get id of select box when accessing onchange function.
Here 2 select box are here, both point to same function <strong>check</strong>.How can i get id of select box when selecting these two select box.ie example1 and example 2.</p>

<pre><code>&lt;select id="example1" onchange='check()'&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;option value="4"&gt;four&lt;/option&gt;
&lt;/select&gt;Example 2 :
&lt;select id="example2" onchange='check()'&gt;
    &lt;option id="1"&gt;one&lt;/option&gt;
    &lt;option id="2"&gt;two&lt;/option&gt;
    &lt;option id="3"&gt;three&lt;/option&gt;
    &lt;option id="4"&gt;four&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>My Jquery Function, But it only getting id of first select box.</p>

<pre><code>&lt;script&gt;
function check(){
 var id = $('select').attr('id');
 alert(id);
}
&lt;/script&gt;
</code></pre>