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

209
Views
JavaScript cambia la URL de div con múltiples img's src cuando se usa onmouseover img's, usando 'esta' tecla y función

Tengo un div con id='image' y background-image url , y tengo 3 imágenes con diferentes src 's- src='/some.jpg' y onmouseover='someFunction(this)'

Cuando coloco el mouse sobre una imagen, quiero cambiar la imagen div a la imagen en la que coloco el mouse.

Dejaré la función vacía, sé que necesito hacer document.getElementById ('image') y probé mucho, con style.background-image y con variable, pero obviamente algo estoy haciendo mal

Este es solo uno de los muchos códigos que probé.

 <div id="image"> display here</div> <img class="preview" src="/img/tee1.jpg" alt="teaTime" onmouseover="upDate(this)" /> <img class="preview" src="/img/tee2.jpg" alt="teaTime2" onmouseover="upDate(this)" /> <img class="preview" src="/img/tee3.jpg" alt="teaTime3" onmouseover="upDate(this)" /> #image { background-image: url("/img/tee3.jpg"); background-color: bisque; width: 300px; height: 300px; border: 5px solid black; } function upDate(element) { }
about 4 years ago · Juan Pablo Isaza
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!