get closest elements attribute value jquery code example
Example: click add class clogest div
$("button").on("click",function(){
$("div").closest("span").addClass("open");
});
$("button").on("click",function(){
$("div").closest("span").addClass("open");
});