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

496
Views
¿Cómo puedo cambiar entre dos colores de fondo usando js setinterval ()?

¿Cómo establecer dos colores de fondo en el javascript por setInterval ()?

 let x = document.body; x.style.backgroundColor = x.style.backgroundColor === "yellow" ? "pink": "yellow";
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Prueba esto:

 var i = 0; function change() { var doc = document.getElementById("background"); var color = ["black", "blue", "brown", "green"]; doc.style.backgroundColor = color[i]; i = (i + 1) % color.length; } setInterval(change, 1000);
 <div id="background">&nbsp</div>

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!