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

481
Views
How to change URL Using javascript ( I want to change button url using javascript)

I want to change belo url using javascript

From:

<a class='button' href="#" target="_blank" id="download_link" style="display: none;"><i class='icon download'></i>Download Now</a>

To

<a class='button' href="https://google.com" target="_blank" id="download_link" style="display: none;"><i class='icon download'></i>Download Now</a>

My code is

<a class='button' href="#" target="_blank" id="download_link" style="display: none;"><i class='icon download'></i>Download Now</a>
<script type="application/javascript">
 var tURL = "https://google.com"
 var download_link = document.getElementById("download_link");
 download_link.innerHTML.replace("#", tURL);

where I do mistake please correct this. I know it is easy to use hyper link in html. but I want to replace urls using javascript

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

var download_link = document.getElementById("download_link");
download_link.href = tURL;

or

var download_link = document.getElementById("download_link");
download_link.setAttribute('href', tURL);
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!