js中判断 .html() 是否为空

String.prototype.isEmpty = function () {
  var s1 = this.replace(/[
]/g, '').replace(/[ ]/g, ''),
      s2 = (s1 == '') ? true : false;
  return s2;
};
$(this).html().isEmpty();
原文地址:https://www.cnblogs.com/zjj1990/p/8086910.html