title: How to get id name using javascript on select tag?
body: <p>How to get <code>id</code> name using javascript on <code>select</code> tag ?</p>
  
  <p>This is my code, when i tested it alerts <code>undefined</code>.</p>
  
  <p>for example when i selected <code>bbb</code> in select tag i'll alert <code>2</code></p>
  
  <p>How can i do it?</p>
  
  <p>This is my <a href="https://jsfiddle.net/nvy8mkk6/" rel="nofollow">fiddle</a></p>
  
  <pre><code>&lt;select id="test" onchange="test_fn()"&gt;
     &lt;option id="1" value="11"&gt;aaa&lt;/option&gt;
     &lt;option id="2" value="22"&gt;bbb&lt;/option&gt;
     &lt;option id="3" value="33"&gt;ccc&lt;/option&gt;
  &lt;/select&gt;
  
  
  
  &lt;script type="text/javascript"&gt;
  function test_fn()
  {
      alert(this.id);
  }
  &lt;/script&gt;
  </code></pre>