Search
 
SCRIPT & CODE EXAMPLE
 

HTML

get input value on button click 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 :: vue router link dynamic id 
Html :: html input autofocus 
Html :: Bootstrap Carousel Image Not Display in Full Width 
Html :: input without autocomplete 
Html :: axonivy sub component 
Html :: how to use pyscript in html 
Html :: Checkbox checked border square CSS 
Html :: input decimal html 
Html :: what to put in http equiv in html 
Html :: codewithmarley 
Html :: html make space between buttons 
Html :: pound symbol phone html 
Html :: use of extends in html django 
Html :: font awesome thumbs up icon 
Html :: how to check where was the changes in a perticuler commit git 
Html :: how to add google icons in html 
Html :: iframe maps 
Html :: test image as base 64 string 
Html :: how to make an input not focusable in html 
Html :: HTML open link in new tab, target="_blank" 
Html :: bootstrap table combine columns 
Html :: phoneto html 
Html :: mailto subject 
Html :: css heading background line 
Html :: at sign html 
Html :: html input radio group 
Html :: how to slow speed of marquee in html 
Html :: automatically refresh a web page 
Html :: js input change form submit 
Html :: html svg favicon 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =