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

87
Vistas
Getting an appended href link with jquery

I am trying to get a link from an appended element.

The link is appended like so:

var imdbPointer = "https://www.imdb.com/title/" + data.imdb_id
imdbLink.empty()
imdbLink.append("<a href='" + imdbPointer + "'>" + "IMDB - " + data.original_title  + "</a>")

This essentially generates an imdb link for me. I was previously using

var storeIMDBLink = $( "a" ).attr( "href") This code successfuly got me the link when it was the only href one the page, however it grabs the first href it finds.

How can I grab a specific href link from this appended element?

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

0

Managed to get there with some hackiness.

var storeIMDBLink = $(this).parent().siblings('#imdb-link').children().attr( "href")

Both the imdb link and button that stored it were appended to the same UL

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