+ 2
How can i use JavaScript to get the input value
How can i use JavaScript to get the value of the number i enter into the textbox. <input id="input" type="number" name="factor" placeholder="Enter A Number" /> <button id="factorize" name="factorize" onclick="factorize()">Factorize!</button>
3 odpowiedzi
+ 3
you can use this one
https://code.sololearn.com/WJdTnT4L72Er/?ref=app
+ 12
<script>
// .value property
onload=function(){
var input = document.getElementById("input");
var b = document.getElementById("factorize");
b.onclick=function(){
alert(input.value);
}
}
</script>
0
hey Maz thanks it worked