Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

135
Views
Hide div is child is empty

The URL to the page is this.

And the screenshot to the questioned area is this.

I want, if the accordion has no content, then hide the accordion title itself. Empty accordion elements won't show.

I have used this script for that:

jQuery(".su-spoiler-content:empty").parent().hide(); 

But I can't find it doing anything.

Is there anything wrong in the above code?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

try that...

document.querySelectorAll('div.su-spoiler-content').forEach(xDiv=>
  {
  if (xDiv.innerText.trim() === '')
      xDiv.closest('div.su-spoiler').style.display = 'none'
  })
about 4 years ago · Juan Pablo Isaza Report

0

It seems that you have "invisible stuff" inside your div.

enter image description here

I just edit as HTML in the browser and it works

enter image description here enter image description here

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!