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

220
Vistas
JavaScript point counter for a html snake like game

I'm new to learning JavaScript, I’ve searched many websites, and cannot find a solution so far.

I am making a mini-game on a base of snake, Can anybody help me make a point counter using javascript and html,

You can check out the game here!

https://github.com/LiquidSlime/Worm-game

and i would like to have it done using

<div id="points"<h1></h1></div>
and javascript;
var element = document.getElementById("points")
**Code here**;

hopefully someone can help me out!

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

0

You can make a span with the id points

<span id=points>? Points</span>

Then in js change the innnerText

const pointElement = document.getElementById('points')

function updatePoints(points) {
  pointElement.innerText = points + ' Points'
}

Then run the update points

updatePoints(1)

// If you want to load if from another varible

// get points from somewhere else

updatePoints(points)

When you want it to update something would be like this in your code

points++;
updatePoints(points)
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