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

219
Views
Cómo agregar estilo a un elemento en el que no se hizo clic

Con este código, obtengo todos los selectores y le agrego un estilo al hacer clic. Cómo agregar estilo al elemento secundario, en qué clase principal childNodes no se hizo clic

 let openSelect = document.querySelectorAll(".multiselect"); openSelect.forEach((item) => { item.addEventListener("click", (e) => { item.childNodes.item(3).style.display = "block"; }); });
 <div class="multiselect"><a></a> <a></a> <a>2</a></div> <div class="multiselect"><a></a><a></a><a>3</a></div>

explique explique

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

0

 document.addEventListener("click", (event) => { openSelect.forEach((item) => { if(!item.contains(event.target)) { item.childNodes.item(3).style.display = "none"; } }); });

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!