Try with attribute selector in jquery
$('[id ^= "table"] tr').find('select').change(function() {
if ($(this).closest('table').find('option[value=' + $(this).val() + ']:selected').length > 1) {
alert('option is already selected');
$(this).val($(this).find("option:first").val());
}
});
Fiddle