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

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

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