New-OMIS/public/assets/js/pages/form-input-spin.init.js

1 line
709 B
JavaScript
Raw Permalink Normal View History

2024-04-04 07:23:00 +00:00
function isData(){var t=document.getElementsByClassName("plus"),e=document.getElementsByClassName("minus"),n=document.getElementsByClassName("product");t&&Array.from(t).forEach(function(t){t.addEventListener("click",function(e){parseInt(t.previousElementSibling.value)<e.target.previousElementSibling.getAttribute("max")&&(e.target.previousElementSibling.value++,n)&&Array.from(n).forEach(function(t){updateQuantity(e.target)})})}),e&&Array.from(e).forEach(function(t){t.addEventListener("click",function(e){parseInt(t.nextElementSibling.value)>e.target.nextElementSibling.getAttribute("min")&&(e.target.nextElementSibling.value--,n)&&Array.from(n).forEach(function(t){updateQuantity(e.target)})})})}isData();