Search
 
SCRIPT & CODE EXAMPLE
 

HTML

input with plus and minus buttons

<div>
  <input id="numberInput"/>
  <button id="plusButton">+</button>
  <button id="minusButton">-</button>
</div>
<script>
  textInput = document.querySelector('#numberInput');
  plusButton = document.querySelector('#plusButton');
  minusButton = document.querySelector('#minusButton');
  plusButton.onclick = () => textInput.value = parseInt(textInput.value) + 1;
  minusButton.onclick = () => textInput.value = parseInt(textInput.value) - 1;  
</script>
Comment

PREVIOUS NEXT
Code Example
Html :: BORDERS WITH TEXT IN IT 
Html :: bootstrap 4 setup 
Html :: bootstrap progress bar with percentage 
Html :: html js make dropdown list checkbox 
Html :: how to add audio in html 
Html :: hambuerger button svg 
Html :: negrita html 
Html :: html lists 
Html :: Meta Tag Generato - SEO 
Html :: bootstrap modal remove gray background 
Html :: html boilerplate vscode 
Html :: aos 
Html :: input number html without e 
Html :: select input placeholder 
Html :: bootstrap 4.5 bold 
Html :: slick html 
Html :: button display text html 
Html :: html nav example 
Html :: jsonplaceholder with delay 
Html :: html typing shortcuts 
Html :: html how to move element to the bottom right of page 
Html :: trash icon html 
Html :: font color Imagefont pil 
Html :: how to add css file in wordpress 
Html :: form example 
Html :: html accordion generator 
Html :: greater then less then in html text 
Html :: year dropdown in html 
Html :: ul html 
Html :: html button click scroll to div 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =