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