Search
 
SCRIPT & CODE EXAMPLE
 

HTML

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

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 = "";
Comment

PREVIOUS NEXT
Code Example
Html :: doctype html charset utf-8 
Html :: rotate svg 
Html :: how to disable right clicking on video using html 
Html :: html no drag image 
Html :: axonivy reuseable component 
Html :: modal footer button center 
Html :: thead position sticky 
Html :: html favicon error code 
Html :: bootstrap 4 search bar 
Html :: ngxcountup suffix 
Html :: bootstrap add html 
Html :: iframe - Full Screen - HTML 
Html :: html numeric keyboard 
Html :: tfoot renders after thead and before tbody 
Html :: my dixon earbuds are not in sync 
Html :: font awesome show password icon 
Html :: html close window button 
Html :: python parse html 
Html :: ionic button trigger ion-datetime 
Html :: open new tab href 
Html :: html redirecting to previous page 
Html :: twig check variables type 
Html :: vue select v-for 
Html :: how to get a division to be in centre of screen in responsive web page for screen of any size 
Html :: html text decoration 
Html :: change color of mark in css 
Html :: how to add datepicker in bootstrap(html form) 
Html :: write html inside component angular 
Html :: html link tag for other website 
Html :: html date 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =