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

221
Views
al presionar el botón de inicio, el color de fondo de la ventana del navegador no cambia usando html, CSS y Javascript

Cuando presiono el botón de inicio, el color de fondo de la ventana del navegador debe cambiar. Primero debe cambiar a rojo durante 30 segundos, luego a amarillo durante 5 segundos y luego a verde durante 30 segundos. Debe suceder al menos una vez. // A continuación se muestra el archivo HTML:

 <!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title></title> </head> <body> <h1>Traffic Light</h1> <div> <button id="btn1">Start</button> </div> </body> <script src="TrafficLightJS.js"></script> </body> </html>

// A continuación se muestra el archivo Javascript:

 const colors=["red","yellow","green"]; const btn=document.getElementById("btn"); //const color=document.querySelector(".color"); btn.addEventListener("click",function()){ setInterval(function()) { document.body.style.background=colors[0]; },30000); setInterval(function()) { document.body.style.background=colors[1]; },5000); setInterval((function()) { document.body.style.background=colors[2]; },30000);

}

// El archivo CSS está a continuación:

 .red { background-color:red; } .yellow { background-color:yellow; } .green { background-color:green; }
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!