javascript - How can I turn input type="tel" into a variable with a number? -


i want user input number input type="tel" or type="number" , make variable number further calculations. far unable identify number. ideas?

function digit() {      var num = document.getelementbyid('inpt');      document.body.innerhtml = num;  }
<input onchange="digit()" type="tel" name="numb" id="inpt" />

try this

<script> function digit() {     var num = document.getelementbyid('inpt').value;     document.body.innerhtml = num; } </script> 

if it's not correct try

console.log(document.getelementbyid('inpt')) 

and show object in browser console


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -