ユーザーが - ボタンをクリックしたときに、負の文字が表示されないようにしたい。カウントは 0 で終了する必要があります。現在、-1、-2、-3 文字も表示されています。0 個のみ、または 0 個以上を表示したい
<script type="text/javascript" >
function plus(){
var addplus = 1;
var plus = document.getElementById('qty').value;
addplus = parseInt(addplus) + parseInt(plus);
document.getElementById('qty').value = addplus;
}
function negtive(){
var neg;
var negtive = 1;
var negtives = document.getElementById('qty').value;
negtive = parseInt(negtives) - parseInt(negtive);
document.getElementById('qty').value = negtive;
}
</script>