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
Post a Comment