When I click on any DOM element I want to check if its parents element contains a specific class or not. I am trying in this way but can't achieve this goal. Does anyone know how?
document.onclick=function(e){
console.log(e.parentElement('.drop').id);
}
Please give solution in JavaScript only - I can't use jQuery.