메뉴 건너뛰기

?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

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


정산담당자
메모

아래는 소스 입니다.
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>last demo</title>
  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
    <button name="addStaff">정산담당자 추가</button>
    <br>
    <br>
    <table border="1" style="width:950px">
        <tbody>
            <tr name="trStaff">
                <td style="width:150px"><strong>정산담당자</strong></td>
                <td style="width:800px">
                    <input type="text" name="staff_name" placeholder="성명">
                    <input type="text" name="staff_contact" placeholder="연락처1">
                    <input type="text" name="staff_contact2" placeholder="연락처2">
                    <input type="text" name="staff_email" placeholder="이메일">
                    <select name="staff_use_yn">
                        <option value="Y">사용</option>
                        <option value="N">미사용</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td><strong>메모</strong></td>
                <td>
                    <textarea style="width:800px" name="memo" rows="3" placeholder="메모를 남겨주세요."></textarea>
                </td>
            </tr>
        </tbody>
    </table>
  
<script>
    //추가 버튼
    $(document).on("click","button[name=addStaff]",function(){
         
        var addStaffText =  '<tr name="trStaff">'+
            '   <td class="active col-md-1"><strong>정산담당자</strong></td>'+
            '   <td class="col-md-11">'+
            '       <input type="text" class="form-control" name="staff_name" placeholder="성명">'+
            '       <input type="text" class="form-control" name="staff_contact" placeholder="연락처1">'+
            '       <input type="text" class="form-control" name="staff_contact2" placeholder="연락처2">'+
            '       <input type="text" class="form-control" name="staff_email" placeholder="이메일">'+
            '       <select class="form-control statusYn" name="staff_use_yn">'+
            '           <option value="Y">사용</option>'+
            '           <option value="N">미사용</option>'+
            '       </select>'+
            '       <button class="btn btn-default" name="delStaff">삭제</button>'+
            '   </td>'+
            '</tr>';
             
        var trHtml = $( "tr[name=trStaff]:last" ); //last를 사용하여 trStaff라는 명을 가진 마지막 태그 호출
         
        trHtml.after(addStaffText); //마지막 trStaff명 뒤에 붙인다.
         
    });
     
    //삭제 버튼
    $(document).on("click","button[name=delStaff]",function(){
         
        var trHtml = $(this).parent().parent();
         
        trHtml.remove(); //tr 테그 삭제
         
    });
</script>
  
</body>
</html>



  1. jQuery - ajaxSubmit 사용법 및 유의사항(페이지 리로드 현상)

    Date2021.03.09 Views1479
    Read More
  2. jQuery - checkbox 전체 선택, 해제 기능 및 단일 체크박스가 해제되었을때 전체 선택 해제 하기

    Date2021.03.09 Views614
    Read More
  3. jQuery - radio, checkBox값 가져오기, 선택하기, 제어 등

    Date2021.03.09 Views544
    Read More
  4. jquery - select option 선택값 가져오기

    Date2018.09.06 Views5332
    Read More
  5. jQuery - 드래그, 리사이즈 이벤트에 따른 영역 침범 막기

    Date2021.03.09 Views363
    Read More
  6. jQuery - 드래그앤드롭(DragAndDrop)을 통한 파일 업로드

    Date2021.03.09 Views293
    Read More
  7. jQuery - 클릭이벤트 동적 처리하기($("").click(), on('click') 차이)

    Date2021.03.09 Views581
    Read More
  8. jQuery Cookie

    Date2016.09.21 Views6864
    Read More
  9. jquery css div, li 리스트 선택한 메뉴 변경 출처: http://okkks.tistory.com/1062 [이건없지]

    Date2017.07.05 Views5811
    Read More
  10. jQuery datepicker 팝업창 사이즈 바꾸기

    Date2019.01.10 Views1648
    Read More
  11. jquery enter key event submit (jquery 엔터키 이벤트)

    Date2016.11.17 Views6857
    Read More
  12. jquery function 생성

    Date2016.09.11 Views6969
    Read More
  13. jQuery Plugin : Slider

    Date2019.01.10 Views1113
    Read More
  14. jQuery Quick API

    Date2016.09.13 Views6934
    Read More
  15. jquery radio checked (라디오 버튼 값으로 선택), 검색 조건 초기 셋팅

    Date2016.11.17 Views10046
    Read More
  16. jQuery selectBox 컨트롤.

    Date2018.07.25 Views2560
    Read More
  17. jQuery Selector (셀렉터)

    Date2016.11.18 Views6941
    Read More
  18. jquery selector / jquery 선택자 / 자주 사용하는 jquery selector 선택자 / selecter

    Date2016.09.09 Views8149
    Read More
  19. jquery timer, javascript countdown (타이머 예제)

    Date2018.11.07 Views81548
    Read More
  20. jQuery tr 추가 (입력창 추가), jQuery 테이블 행 추가/삭제, selector last name

    Date2016.11.17 Views8547
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 Next
/ 9

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved