ผมทำแล้วไม่ได้แฮะ
คุณ rungroat4 ว่าไงครับ
อ่าว เครื่อง หมาย " " ถูกลบออกหมดเลย ไม่เป็นไรคับเดี๋ยยวผมลองใส่แป๊บไม่ใช้ tag code
------------------------------------------------------------------------------------------------------
code ด้านล่าง แล้วให้เปลี่ยน @ เป็นเครื่องหมาย "บวก" ให้หมดเลยคับ
------------------------------------------------------------------------------------------------------
<script>
function plus(n)
{
document.getElementById('sum'@n).value=parseFloat(document.getElementById('sum'@n).value)@1;
}
function del(n)
{
if(parseFloat(document.getElementById('sum'@n).value)>0)
{
document.getElementById('sum'@n).value=parseFloat(document.getElementById('sum'@n).value)-1;
}
}
</script>
<input type="button" value=" - " onclick="del('1');">
<input type="text" name="num1" value="1" size="10" style="text-align:center;" id="sum1">
<input type="button" value=" @ " onclick="plus('1');">
<br>
<input type="button" value=" - " onclick="del('2');">
<input type="text" name="num2" value="1" size="10" style="text-align:center;" id="sum2">
<input type="button" value=" @ " onclick="plus('2');">
<br>
<input type="button" value=" - " onclick="del('3');">
<input type="text" name="num3" value="1" size="10" style="text-align:center;" id="sum3">
<input type="button" value=" @ " onclick="plus('3');">
------------------------------------------------------------------------------------------------------