You're trying yo use the DOM element itself instead of using its value . Once you get its value, don't forget to cast is to an int with parseInt:
value
parseInt
var number = parseInt(document.getElementById("number").value);
2.1m questions
2.1m answers
60 comments
57.0k users