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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -