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

183
Views
¿Cómo obtener el último hijo del elemento principal usando el método de selección de consultas?

Por ejemplo:

 <div class="list-container"> <p>hello<p> <p>hello<p> <p>hello<p> <p>hello<p> </div>

¿Cómo obtener ese último elemento secundario? Me gustaría señalar que los elementos secundarios se crean dinámicamente y aumentan o disminuyen según el antojo del usuario. Y quiero poder elegir al último niño cada vez que esto suceda. Por eso pregunto. Por favor, compárteme la sintaxis. Gracias.

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

0

.list-container > p:last-child servirá

Y por favor, evita el bloatware, como jquery...

 console.log(document.querySelector(".list-container > p:last-child"));
 <div class="list-container"> <p>hello1</p> <p>hello2</p> <p>hello3</p> <p>hello4</p> </div>

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!