jquery - Finding parent class using .parent and .hasClass -
how can find parent class of clicked element?
currently running on .click
event of element called .cross
i want find parent classnames:
var status = $(this).parent(this).hasclass(); console.log(status);
the code above outputs false
in console rather classname.
how can find parent class of clicked element?
$(this).parent().attr("class")
Comments
Post a Comment