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

198
Views
.innertext no cambia el documento

El método .innerText cambia el texto en el elemento h2 pero no muestra nada en la etiqueta p. Por favor, ¿qué no estoy haciendo correctamente?

 let increaseCount = document.getElementById("counter") let saveEl = document.getElementById("save-el") let click = 0 function increment() { click += 1 increaseCount.innerText = click } function save() { let countStr = click + " - " saveEl.innertext += countStr console.log(save) }
 <body> <div class="container"> <h1>People entered</h1> <h2 id="counter">0</h2> <div class="button"> <button id="increment-btn" onclick="increment()">INCREMENT</button> <button id="save-btn" onclick="save()">SAVE</button> </div> <p id="save-el">Previous Entries:</p> <script src="main.js"></script> </div> </body>

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

0

cambiar innertext a innerText , no es lo mismo, hay que tener cuidado con las mayúsculas

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!