Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

219
Vistas
Why is javascript not making the value more than 1 using the +1

I can not make the output number bigger than one when I click a button I a using the +1 operator. I have search everywhere but just can not find a easy and good solution.

<script>
  function more() {
    document.getElementById("more").innerHTML = +1; //plus one
  }
</script>

<p>You have </p>
<a href="#" id="more" class="list-group-item disabled">0 </a>
<img src="coin.png" width="2%" alt="coins">

<button onClick="more()">More!</button>//the button

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

When you post a question try to post just what's needed. Your php doesn't really add anything to the problem. First get sum, then increase it by 1, then set innerHTML

function more() {
  let sum = document.getElementById("more").innerHTML
  sum++
  document.getElementById("more").innerHTML = sum
}
<p>You have </p><a href="#" id="more" class="list-group-item disabled">0 </a>

<button onClick="more()">More!</button>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda