I have to traverse up until element have id attribute. My problem here is element is not definite and sometimes parent have id attribute, sometimes grandparent have id attribute like that goes on. I try like
var id = $(this).closest().find("['id']").attr("id");
i dont have such ideas to do this . Can anyone help me