Bug Bounties

Increment decrement input value using jquery

The intent is to change the input value without it going minus values

    <div class="input-number">
	<input id="dinamic" type="number" min="1" value="1">
    <span class="qty-up">+</span>
    <span class="qty-down">-</span>

$(document).ready(function() { 

$(".qty-up").click(function() { //get element by class name
   $("#dinamic").get(0).value++ //input value

$(".qty-down").click(function() { //get element by class name
    if( $("#dinamic").val() < 2){
        $(this).val('1'); //input value

     else $("#dinamic").get(0).value--

⇐ Create a lovely card animation using Framer MotionSkeleton loading using only a few lines of CSS ⇒