删除ul标签下没有li元素的ul 如何用JQUERY实现

2025-02-25 04:23:00
推荐回答(1个)
回答1:

$(".topnav ul.subnav").each(function() {
if(!$(this).find("li").length) {
$(this).remove();
}
});