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

195
Views
Obtener el atributo del elemento secundario

Si tengo el siguiente marcado:

 <p class="header hours"> <a href="javascript:void(0)" class="sort" sortcat="hours"> Hours&nbsp;<span class="imgholder" sortcat="hours">&nbsp;</span> </a> </p>

¿Cómo puedo orientar la etiqueta <span> dentro de la etiqueta de anclaje? Hay otras cinco entradas de etiqueta <p> similares, cada una con un valor diferente para sortcat=

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

$(".sort").click(function(){ var cat = $(this).children("span").attr("sortcat"); //do something with the sortcat });
over 4 years ago · Santiago Trujillo Report

0

$("a span[sortcat]").attr('sortcat')

Eso le dará el valor sortcat del primer elemento. Para obtenerlos todos, haz esto:

 $("a span[sortcat]").map(function(){ return $(this).attr('sortcat') })

Vea esta demostración de trabajo: http://jsfiddle.net/BwgDW/

over 4 years ago · Santiago Trujillo Report

0

$('.sort span')

¿Entendí mal?

over 4 years ago · Santiago Trujillo 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!