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

231
Views
Poner imagen en la primera página en la segunda página javascript

Entonces, mi problema es que tengo dos páginas products.html e index.html en products.html. Tengo varias imágenes y un botón al lado de cada imagen y cada botón corresponde a cada imagen y cuando haces clic en el botón se vincula a index.html. y en index.html tengo 1 imagen. Quiero hacer que cada vez que haga clic en un botón me lleve a la página index.html y la imagen correspondiente en products.html se coloque en la imagen index.html.

 <div class="imgbx"> <button onclick="window.location.href='index.html'" >Invisible button</button> <img src="images/xr-black.jpg" alt=""> </div>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Dentro de products.html añadir

 <div class="imgbx"> <button onclick="window.location.href='index.html?image=images/xr-black.jpg'" >Invisible button</button> <img src="images/xr-black.jpg" alt=""> </div>

En su main.html agregue

 <img src="img" id="image"> <script> const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const image = urlParams.get('image') document.getElementById('image').src = image; </script>
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!