KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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 ?
Tags (comma-separated)
Save Edits
Cancel