메뉴 건너뛰기

?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>수량 증가/감소 (JQuery로 작성.)</title>
  <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
  <script type="text/javascript">
    
    /**
    * 수량 증가/감소 (JQuery로 작성.)
    */

    function modifyProductQuantity(id, quantity){
        
         if(isNaN($("#"+id).val())){
              alert'숫자만 입력가능 합니다.' );
              $("#"+id).focus();
              $("#"+id).val(0);
              return;
         }
        
         //var v = parseFloat($("#"+id).val())+parseFloat(quantity);    
         //$("#"+id).val(Math.round(v*10)/10);
          
         var q = parseInt($("#"+id).val())+parseInt(quantity);    
         $("#"+id).val(q);


    };



 </script>
 </head>
 <body>
    수량 : 
    <input name="quantity" id="quantity" style="vertical-align:middle; text-align:right" size="5" maxlength="4" value="0" />
    <img style="vertical-align:middle;" alt="수량 증가 감소" src="btn_cnt.gif" usemap="#map_name_quantity"/>
    <map id="map_name_quantity" name="map_name_quantity">
        <area href="javascript:modifyProductQuantity('quantity',1);" shape="rect" alt="수량 증가" coords="0,0,9,10"/>
        <area href="javascript:modifyProductQuantity('quantity',-1);" shape="rect" alt="수량 감소" coords="0,10,9,20"/>
    </map>

 </body>
</html>

 



  1. 예제 - 자바스크립트로 현재 달의 달력 만들기 (calendar)

    Date2015.06.19 Views10541
    Read More
  2. 마우스 드래그, 오른쪽 팝업메뉴, 선택 막기 (IE11, 파이어폭스, 크롬 확인)

    Date2015.06.19 Views8856
    Read More
  3. Checkbox : 체크박스 체크여부 확인

    Date2015.06.19 Views19351
    Read More
  4. 텍스트박스(input type = "text") 숫자 증가, 감소 시키기 - 쇼핑몰 주문 수량

    Date2015.06.19 Views12584
    Read More
  5. 정규식을 이용한 콤마(comma) 제거하기

    Date2015.06.19 Views7124
    Read More
  6. 정규식을 이용한 실시간 콤마(comma) 넣기

    Date2015.06.19 Views8202
    Read More
  7. 자바스크립트로 네트워크 연결 확인하기 (Navigator onLine Property)

    Date2015.06.19 Views6603
    Read More
  8. location.href 로 새창 여는 방법 (target=_blank 효과)

    Date2015.06.19 Views10273
    Read More
  9. CheckBox 전체 선택 & 해제

    Date2015.04.28 Views5926
    Read More
  10. 선택(CheckBox) 된 Row 삭제 - 화면에서 추가된 Row

    Date2015.04.28 Views13855
    Read More
  11. 선택된 데이터 부모창에 넘기기 (iframe ☞ 부모창)

    Date2015.04.28 Views6919
    Read More
  12. 2단계 트리메뉴 마우스오버(mouseover), 온포커스(onfocus) 구현

    Date2015.04.06 Views8626
    Read More
  13. jquery 메뉴 - 아래로 한번에 전체가 펼처짐

    Date2015.04.06 Views12014
    Read More
  14. 자바스크립트 이벤트 목록입니다. ( javascript event )

    Date2015.04.06 Views5861
    Read More
  15. '레이블', 반복문을 제어하자!

    Date2015.02.03 Views5807
    Read More
  16. 'Array', 배열 및 다차원 배열 선언에 대해 알아보자!

    Date2015.02.03 Views11423
    Read More
  17. 배열의 리터럴 선언, 또다른 배열 선언 방법!

    Date2015.02.03 Views6696
    Read More
  18. '문자 ↔ 숫자', 타입을 바꿔보자!

    Date2015.02.03 Views6512
    Read More
  19. 드롭다운 메뉴를 만들어보자! -1탄

    Date2015.02.03 Views8481
    Read More
  20. 'onmouseover', 마우스 오버 효과 - 글씨 바꾸기!

    Date2015.02.03 Views9758
    Read More
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 10 11 12 13 Next
/ 13

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved