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

150
Views
Encuentre el elemento directamente encima del elemento en el que se hizo clic en dom a través de jQuery

Cuando se hace clic en un elemento con la clase facetwp-color-label , intento usar jQuery trigger() en el elemento dom class="facetwp-color" directamente arriba.

ingrese la descripción de la imagen aquí

Código actual:

 $(document).on('click', '.facetwp-color-label', function() { $(this).closest('.facetwp-color').trigger('click'); });

Probé con anterior(), siguiente(), más cercano(). Ninguno se está activando hasta ahora. Aquí está mi intento manual de confirmar que .trigger() funciona en el elemento al que me dirijo:

 $(document).on('click', '.facetwp-color-label', function() { $(this).closest('.facetwp-color').trigger('click'); console.log(this); });

Resultado:

 <div class="facetwp-color-label">Cream</div>
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!