How to make a document.getElementById value into an integer variable, not a string?
Solution 1:
The unary plus (+
) coerces its operand into a number:
var results = +document.getElementById("addTweets").value;
...
typeof( results ); // number
Solution 2:
Use parseInt:
var results = document.getElementById("addTweets").value;
var intResults = parseInt(results, 10) + mod;