I have some div\'s that maybe be empty (depending on server-side logic).
10条回答 渐次进展 (楼主) 2020-12-03 08:20 I used the filtering answer, but this.childNodes.length kept returning 1 also when there was no visible content, so ended up combining filter with trim. $("div").filter(function() { return j(this).text().trim() === ""; }).hide(); 0 讨论(0) 查看其它10个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
I used the filtering answer, but this.childNodes.length kept returning 1 also when there was no visible content, so ended up combining filter with trim.
$("div").filter(function() { return j(this).text().trim() === ""; }).hide();