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

141
Vistas
How to print out the final selector in a jQuery method chain

If I have the following jQuery chain

 let mpath = $('.wlc2022.confirm').find('.something');

how can I print out ".something" or "something" (in either jQuery or raw JavaScript syntax) to the console window because its the last selector that mpath is looking for?

I have tried...

console.log(mpath.val)
console.log(mpath.value)

But nothing so far...

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

0

There is no API for that in modern (post-3.0) versions of jQuery. There used to be a .selector property on jQuery objects, but it was removed because it was unreliable.

Note also that mpath itself is not "looking for" anything; it gets the result of the jQuery-based expression. Probably the best way to do what you want would be to construct some sort of utility around that expression pattern, and have it retain that last selector and make it available somehow.

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