Home > Back-end >  Hide div is child is empty
Hide div is child is empty

Time:10-24

The URL to the enter image description here

I just edit as HTML in the browser and it works

enter image description here enter image description here

CodePudding user response:

try that...

document.querySelectorAll('div.su-spoiler-content').forEach(xDiv=>
  {
  if (xDiv.innerText.trim() === '')
      xDiv.closest('div.su-spoiler').style.display = 'none'
  })
  • Related