When I click on the increase or decrease button, the input value with the cartitemCount ID changes dramatically, but does not enter the onchange event, where is my problem, thank you for your help
<div class="qty qty-changer">
<fieldset>
<input type="button" value="‒" class="decrease">
<input id="cartitemCount" onchange="EditCartItem()" type="text"
class="qty-input" value="@item.Count" data-min="1" data-
max="@item.CurrentCount">
<input type="button" value="+" class="increase">
</fieldset>
</div>
JavaScript code:
function EditCartItem()
{
var cartitemcount=$("#cartitemCount").val();
$.ajax({
type: "Get",
url: "/CartItem?handler=EditColorToCartItem",
dataType: "json",
contentType: "application/json",
data: {count :cartitemcount} ,
success: function (data) {
if (data.isValid) {
Swal.fire(data.message);
}
},
error: function (xhr) {
// do what ever you want to do when error happens
}
});
}