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

219
Views
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 answers
Answer question

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 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!