js找父元素下的指定子元素加class类名

function D(t) {
if (!t)
return;
const e = t.xxx;
$(".top-toolbar").children().each((function() {
const i = $(this);
switch (i.attr("title")) {
case "你好":
return void L(i, e.autoWrap);
default:
return
}
}
))
}

 


function L(t, e) {
e ? t.addClass("active") : t.removeClass("active")
}

posted @ 2022-06-24 16:19  文磊啊~  阅读(1059)  评论(0编辑  收藏  举报