เข้าชม :
598
|
|
<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');">
![]() |
|





