$('some_element').closest('parents_element').attr('id'); $('some_element').parents('parents_element').attr('id'); $('some_element').parent().attr('id');