Answers for "how to get the value of a textbox in javascript"

5

how to get value of textbox in javascript from html

<!--
This is example is with a number...
But you can do it with whatever input type you want
-->
<input type="number" name="numberInput" id="numberInput" max="20" min="1" step="1">
<button type="button" onclick="myFunction()">sumbit</button>

<script>
  function myFunction() {
    let tokenAmount = document.getElementById("numberInput").value;
    return // whatever you want to do with it
  }
</script>
Posted by: Guest on September-15-2021
56

Javascript get text input value

var inputValue = document.getElementById("myTextInputID").value;
Posted by: Guest on July-26-2019
0

how to get the value of a textbox in javascript

let link = document.getElementById("link_box").value
    console.log(link)
    document.getElementById("link_box").value = "";
Posted by: Guest on March-16-2021

Code answers related to "how to get the value of a textbox in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language