56
rated 0 times
[
57]
[
1]
/ answers: 1 / hits: 142531
/ 14 Years ago, sun, january 30, 2011, 12:00:00
I need javascript to add 5 to an integer variable, but instead it treats the variable as a string, so it write out the variable, then add 5 onto the end of the string. How can I force it to do math instead?
var dots = document.getElementById(txt).value; // 5
function increase(){
dots = dots + 5;
}
Output: 55
How can I force it to output 10
?
More From » string