fire input onchange event after click on button tag

I am doing calculation with function ("update_total") by "onchange" event of input tab number.
it is working fine. no any issue.

when i am using jquery plugin "Nice-Number" for showing plus(+), minus(-) button.

onchange event of input tag is not getting fire. because mouse get clicked on plus(+) or minus(-) button.

therefor i am not getting ("update_total") total value.

please help how to resolve this issue.

$(function() {

function update_total(spineerid, product_price, totalid) {
  spineerid = '#' + spineerid;
  totalid = '#' + totalid;

  var qty_count = $(spineerid).val();
  var total = product_price * qty_count;
  $(totalid).html(total + '/-'); // display total 
<script src=""></script>
<link rel="stylesheet" href="" />
<script src=""></script>

<div class="card" style="width:12rem">
  <div class="card-header">
    <?php echo $row['product_name'] ?>
  <img src="product-images/<?php echo $row['product_image']; ?>" class="card-img-top" alt="..." height="150px">
    <span> &#8377;<?php echo$row['product_price']?> </span>
    <input type="number" min="1" value="1" name="spinnerNumber<?php echo $row['product_id']?>" id="spinnerNumber<?php echo $row['product_id']?>" onchange="update_total('spinnerNumber<?php echo $row['product_id']?>','<?php echo$row['product_price']?>','total<?php echo $row['product_id']?>')">

  <div class="card-footer">
    <!-- Total -->
      Total: &#8377; <span id="total<?php echo $row['product_id']?>">0</span>

3 thoughts on “fire input onchange event after click on button tag”

Leave a Comment