I have some div\'s that maybe be empty (depending on server-side logic).
10条回答 抹茶落季 (楼主) 2020-12-03 08:06 If div contains white-space or line breaks then this code may be helpful... $(document).ready(function() { str = $('div.section').text(); if($.trim(str) === "") { $('div.section').hide(); } }); 0 讨论(0) 查看其它10个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
If div contains white-space or line breaks then this code may be helpful...
$(document).ready(function() { str = $('div.section').text(); if($.trim(str) === "") { $('div.section').hide(); } });