-2

I once had some code that constantly incremented the number but I can't find it anywhere. It was in so it's definitely something to do with javascript. If someone could help me it would mean the world to me.

Alon Eitan
  • 11,997
  • 8
  • 49
  • 58
Joe7394
  • 3
  • 1
  • Welcome to Stack Overflow! Pure code-writing requests are off-topic on Stack Overflow — we expect questions here to relate to _specific_ programming problems — but we will happily help you write it yourself! Tell us what you've tried, and where you are stuck. This will also help us answer your question better. – Adrian W Dec 02 '18 at 21:25
  • 2
    Possible duplicate of [Other ways to increment a variable in JavaScript](https://stackoverflow.com/questions/6594325/other-ways-to-increment-a-variable-in-javascript) – mickmackusa Dec 02 '18 at 23:01

2 Answers2

0

What do you want to do ? with this :

var number = 0;
function increment() {
    number++;
}
Shim-Sao
  • 2,026
  • 2
  • 18
  • 23
0

I agree with Shim-Sao but if you are referring to HTML, then maybe do you mean this?

<script type="text/javascript">
var number = 0;
function increment() {
    number = number + 1;
}
</script>

This is an inline javascript so that you can use it directly on your HTML file. Please define more how what will be the event that the number in the HTML will increment to make the question clearer.

Earl. Fojas
  • 79
  • 3
  • 12