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

218
Views
¿Cómo puedo poner mis letras del temporizador de cuenta regresiva debajo del temporizador?

Por ejemplo: 1 23 3 59 dhms

¿Cómo puedo hacerlo con mi código existente?

mi código:

índice.html

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <h2 id="countdown"></h2> <script src="main.js"></script> </body> </html>

principal.js

 CountDownTimer('06/15/2022 07:30 PM', 'countdown'); function CountDownTimer(dt, id) { let end = new Date(dt); let _second = 1000; let _minute = _second * 60; let _hour = _minute * 60; let _day = _hour * 24; let timer; function showRemaining() { let now = new Date(); let distance = end - now; if (distance < 0) { clearInterval(timer); document.getElementById(id).innerHTML = 'The event started!'; return; } let days = Math.floor(distance / _day); let hours = Math.floor((distance % _day) / _hour); let minutes = Math.floor((distance % _hour) / _minute); let seconds = Math.floor((distance % _minute) / _second); document.getElementById(id).innerHTML = days; document.getElementById(id).innerHTML += hours; document.getElementById(id).innerHTML += minutes; document.getElementById(id).innerHTML += seconds; } timer = setInterval(showRemaining, 1000); }

Pude ponerlo al lado de las letras pero no debajo de cada temporizador... Por cierto, soy nuevo en JS.

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

0

 CountDownTimer('06/15/2022 07:30 PM', 'countdown'); function CountDownTimer(dt, id) { let end = new Date(dt); let _second = 1000; let _minute = _second * 60; let _hour = _minute * 60; let _day = _hour * 24; let timer; function showRemaining() { let now = new Date(); let distance = end - now; if (distance < 0) { clearInterval(timer); document.getElementById(id).innerHTML = 'The event started!'; return; } let days = Math.floor(distance / _day); let hours = Math.floor((distance % _day) / _hour); let minutes = Math.floor((distance % _hour) / _minute); let seconds = Math.floor((distance % _minute) / _second); document.getElementById(id).innerHTML = days+ " "; document.getElementById(id).innerHTML += hours + " "; document.getElementById(id).innerHTML += minutes+ " "; document.getElementById(id).innerHTML += seconds+ " <br/>"; document.getElementById(id).innerHTML += "D "; document.getElementById(id).innerHTML += "M "; document.getElementById(id).innerHTML += "H "; document.getElementById(id).innerHTML += "S "; } timer = setInterval(showRemaining, 1000); }
 <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <h2 id="countdown"></h2> <script src="main.js"></script> </body>

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!