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

84
Views
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 answers
Answer question

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 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!