Add bag.js

This commit is contained in:
Moe Poi ~ 2021-11-10 12:00:54 +07:00
parent c703a77b65
commit 26c125afc5

19
public/js/bag.js Normal file
View file

@ -0,0 +1,19 @@
function add(id) {
var inputCount = document.getElementById(id);
console.log("I got clicked");
if (inputCount.value < 9) {
inputCount.value++;
} else {
alert("MAX product reach");
}
}
function minus(id) {
var inputCount = document.getElementById(id);
console.log("Minus got clicked");
if (inputCount.value > 1) {
inputCount.value--;
} else {
alert("Remove this item");
}
}