2

I'd like to do the following. This is my element. I'd like

<div class="toc uk-panel" style="margin: 0px;"><ol></ol></div>

to select this and check, whether it's empty or not. If it is empty, I'd like to hide it.

Using

.toc:empty {
     display: none;
}

Does not work, because it contains a ol element. Is it possible to check, whether the ol element is empty and if so, remove both, ol and div?

Temani Afif
  • 180,975
  • 14
  • 166
  • 216
SPQRInc
  • 243
  • 1
  • 10
  • 23

0 Answers0