检测是否所有的栏位都已经填充了内容了。(可以用来判断动态放置的东西和外加的框是否一致)

/**
* 检测是否所有的栏位都已经填充了内容了。
* @return true - 表示所有的栏位都已经填充了内容了,false - 表示并不是所有栏位都填充内容了。
*/
function checkAllBlanksFilled() {
  var showHow = document.querySelector('.show-how');
  var slotCount = document.querySelectorAll('.slot').length;
  var filledSlotCount = document.querySelectorAll('.slot[data-status="y"]').length;
  return (slotCount === filledSlotCount);
}

原文地址:https://www.cnblogs.com/patriot/p/5716134.html