Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
jQuery how to replace :last selector if I need its children?

I am upgrading my code for the latest jQuery, but I stumbled into a problem with deprecated :last selector. In most cases, all I needed to do was to delete it and slap .last() after, but I have a problem with this:

$('#someId tr:last textarea').each(function(){
    //some code
});

where :last is not the ultimate thing I want to select. I don't even know how to form the google question for this. How can I approach this?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can still continue selecting after .last() (that's basic functionality of jquery, I advice to read up on it if you want to continue to use it) or simply use css selector :last-child

$('#someId tr:last-child textarea').each(function(){
    //some code
});

or

$('#someId tr').last().find('textarea').each(function(){
    //some code
});
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda