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

111
Views
Guardar el último conteo después del incremento

Estoy haciendo un contador simple con un botón. Presiono el botón y aumenta, eso funciona correctamente. Pero también estoy tratando de crear una función "Guardar" en la que pueda guardar su último conteo. Está regresando con "No se pueden establecer propiedades de nulo (estableciendo 'texto interno').

 let buttonCount = 0 let countEl = document.getElementById("count-el") let saveEl = document.getElementById("save-el") function increment() { buttonCount += 1 countEl.innerText = buttonCount console.log(buttonCount) } function save() { let countStr = buttonCount + " - " saveEl.innerText = countStr }
 <title>Passenger Counter</title> <h1>People Entered:</h1> <h2 id="count-el">0</h2> <script src="index.js"></script> <button id="increment-butn" onclick="increment()">INCREMENT</button> <button id="save-butn" onclick="save()">SAVE</button> <p id="save-el">Previous Entries: </p>

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!