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

480
Views
Cómo cambiar la URL usando javascript (Quiero cambiar la URL del botón usando javascript)

Quiero cambiar la url de belo usando javascript

De:

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

A

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

mi codigo es

 <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);

donde me equivoco por favor corregir esto. Sé que es fácil usar un hipervínculo en html. pero quiero reemplazar las URL usando javascript

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

0

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

o

 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!