fupEmibemerie
New Member
Im trying to make a score board, and its adding on numbers weirdly:My html:\[code\]<div id="game-info"> Top score: <p id="top-score">0</p><br> Current score: <p id="current">0</p><br> Games played: <p id="played-games">0</p></div>\[/code\]My javascript:\[code\]var score = document.getElementById("current");if(blabla scored points){ score.innerHTML += 100;}if(blabla scored -points){ score.innerHTML -= 10;}\[/code\]The minus points work fine-ish, at least it adds up negatively, but the positive score will add itself to the end on the current score, like so:\[code\]Current score: <p id="current">0100</p><br>\[/code\]or\[code\]Current score: <p id="current">-20100</p><br>\[/code\]Does this have anything to do with that its a string and not an int? Im confused why the negative score works and the positive doesnt when its the same markup..