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

71
Views
Assign unique IDs to multiple template instances

I have a widget card template which will be used multiple times on a single page by the site's content managers.

<div class="program-feature-card">
  <div class="elementor-cta__bg-wrapper">
    <div>
      Some content here...
    </div>
    <a id="click-for-more-info" class="" onclick="showHide()" href="#" >More Info</a>
    <div id="more-info" class="hide">
      More info here...
    </div>
</div>

The showHide function works to toggle the visibility for #more-info, but only as long as there's a single instance of the widget on a page.

function showHide() {
  var element = document.getElementById("more-info");
  element.classList.toggle("hide");
  var element = document.getElementById("more");
  element.classList.toggle("more-active");
}

How can I assign unique IDs to each instance of the card?

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!