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

191
Views
Nested Dropdown FAQ implementation using javascript in markdown language

I've been searching all the net and the StackOverflow for a while and couldn't really find a specific example about my case. I am embedding javascript to a website and I am manipulating markdown language to create dropdown menus.

    <script>      $(document).ready(function(){

    $('.markdown-block .sqs-block-content h3').css('cursor','pointer');

    $(".markdown-block .sqs-block-content h3").nextUntil("h3").slideToggle();

    $(".markdown-block .sqs-block-content h3").click(function() {$(this).nextUntil("h3").slideToggle();});

    });    </script>

This is the script that I am using. It's working when I implement it with only but only "###" however, I want to implement it with depth level 2. Namely, I want h3 that has sub headers like h4 and they are inside the content of h3 and h4 headers will also be dropdown. I tried to implement it yet it's somehow broken. I will put the image below.

When the h3 is closed the content is somehow shown.

When the h3 is not clicked, the content under h4 is somehow shown.

click on h3

When I click h3, content under h4 is gone and now h4s come.

h4 is clicked

When the h4 is clicked finally the content is shown again.

I don't know why this is happening. I tried writing the same javascript code for also h4 and it really made it worse. Without h4 js code there is only dropdown for general headers (h3) and that's not what I want. Thanks in advance!

about 4 years ago · Juan Pablo Isaza
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!