Q:

Get id of clicked element using jquery

I have a series of select boxes within a table.  The html is:
<td id="1">
  <select id="a" name="xxx"> 
     <option ... </option>
  </select>
</td>

<td id="2">
   <select id="b" name="yyy"> 
     <option ... </option>
   </select>
</td>

... etc. 

When a select box option is changed, how can i use jquery to return the id of the select box and the td? 
I think it should be something like:
$(document).ready(function() {

    $('select').change(function() { 
    var id = $(this).attr('id');
    return false; 
    });
});

Working Fiddle

A:

You can also use on function with change event and find the td using the closest
$(document).ready(function() {
        $('select').on('change',function() { 
            var id = $(this).attr('id');
            var tdid = $(this).closest('td').attr('id');
            return false; 
        });
});

