Search
 
SCRIPT & CODE EXAMPLE
 

HTML

how to read an input from HTML in javascript

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

PREVIOUS NEXT
Code Example
Html :: bootstrap button tooltip 
Html :: justify content space between class bootstrap 
Html :: how to remove options for video tag in html 
Html :: how to add button to open a website using html 
Html :: bs4 no border 
Html :: disable textarea html 
Html :: git 443 operation timed out 
Html :: GEThttp://127.0.0.1:5500/favicon.ico error 
Html :: dropdown menu html 
Html :: how to break between characters in html 
Html :: css setting table column width 
Html :: tailwind display inline block 
Html :: learn web development 
Html :: move table tfoot at top 
Html :: css keep hyphenated words together 
Html :: how to redirect a page to another url in html 
Html :: how to disable input form when select change 
Html :: textarea autosize angular 
Html :: how to make an image a full background in html 
Html :: link open new tab 
Html :: vim set line wrap 
Html :: bootstrap latest version cdn 
Html :: nuxt select option v-for 
Html :: ion2 calendar change event 
Html :: how to color div html 
Html :: markdown bulleted list 
Html :: html placeholder multiple lines 
Html :: difernce between innertextand neer html 
Html :: posting with forms html 
Html :: html input date min 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =