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

204
Views
¿Por qué mi cronómetro no se pone en marcha cuando hago clic en el botón de inicio?

Este es el cronómetro que hice, pero el botón de inicio no funciona; en realidad, no inicia el cronómetro.

He intentado buscar soluciones en internet pero no he podido encontrar nada.

 var seconds = 00; var tens = 00; var appendTens = document.getElementsByClassName("tens"); var appendSeconds = document.getElementsByClassName("seconds"); var buttonStart = document.getElementById("btn-start"); var buttonStop = document.getElementById("btn-stop"); var buttonReset = document.getElementById("btn-reset"); var interval; function startTimer() { tens++; if (tens < 9) { appendTens.innerHTML ="0" + tens; } if (tens > 9) { appendTens.innerHTML = tens; } if (tens > 99) { seconds++; appendSeconds.innerHTML = "0" + seconds; tens = 0; appendTens.innerHTML = "0" + 0; } if (seconds > 9) { appendSeconds.innerHTML = seconds; } }; buttonStart.onclick = function() { interval = setInterval(startTimer); } buttonStop.onclick = function() { clearInterval(startTimer); }
 <!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"> <link rel="stylesheet" href="stopwatch.css"> <title>StopWatch</title> </head> <body> <div class="container"> <img src="/iconmonstr-clock-thin.svg" alt=""> <h2>StopWatch</h2> <p><span class="seconds">00</span>: <span class="tens">00</span></p> <button class="btn" id="btn-start">Start</button> <button class="btn" id="btn-stop">Stop</button> <button class="btn" id="btn-reset">Reset</button> </div> <script src="stopwatch.js" type="application/javascript"></script> </body> </html>

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!