ยินดีต้อนรับ กรุณา สมัครสมาชิก หรือเข้าสู่ระบบ

Home » webboard » PHP
เข้าชม : 598

java + -

โพสต์เมื่อ: วันศุกร์ 25 พฤษภาคม 2555  21:09 น.

<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');">





คุณต้องสมัครสมาชิก ถึงจะโพสกระทู้ได้

ปิดรับสมัครสมาชิกแล้ว