Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- @AllArgsConstructor
- 백준 1235번
- SQL
- interrupted()
- 생성자
- ajax
- 자바 람다식
- MariaDB Query Log
- pseudo-code
- InterruptException
- map()
- @NoArgsConstructor
- 구간합
- 백준 11659번
- 백준 11660번
- json
- jquery
- 구간합구하기
- Java
- 슈더코드
- 마리아DB 쿼리 로그
- Bean LifecCycle
- 합배열
- this와 this() 차이
- function test
- 2차원배열 구간합
- 백준
- this
- select
- 상속과 참조
Archives
- Today
- Total
평범한 연구소
[jQuery] 형제 태그(div)의 내용(p) 가져오기 본문
<div class=0"input-session education-input">
<div class="input-title"><h4>학력 사항</h4></div>
<div class="input-box">
<div>
<p>
<input type="text" name="schoolName" class="form-control" style="width: 27%;"
placeholder="학교명을 입력하세요">
<input type="date" name="schoolDate1" class="form-control" style="width: 27%;"
placeholder="입학날짜를 입력하세요"> ~
<input type="date" name="schoolDate2" class="form-control" style="width: 27%;"
placeholder="졸업날짜를 입력하세요">
<span class="schoolRemoveBtn" style="float: right;"><i class="far fa-minus-square"></i></span>
</p>
</div>
<div style="text-align: center; margin-top: 10px;">
<button type="button" class="btn schoolAddBtn">추가</button>
</div>
</div>
</div>
$(function() {
$(".schoolAddBtn").click(function() {
const p = $(this).parent().parent().find("div:first-child :first").clone();
$(p).find("input").each(function() {
$(this).val("");
});
// $(this).parent().parent().find("div:first").append(p);
$(this).closest(".input-box").find("div:first").append(p);
});
});
'Pront > jQuery' 카테고리의 다른 글
[jQuery] 모달창 내부 select에서 선택된 option 값 가져오기 (0) | 2022.10.25 |
---|---|
[jQuery] table 선택된 행 데이터 가져오기 (0) | 2022.10.25 |
[jQuery] ajax (0) | 2022.10.22 |
[jQuery] 요소의 추가, 복사, 삭제, 대체 (append,wrap,clone,remove...) (0) | 2022.10.19 |
[jQuery] 선택자 (selector) (0) | 2022.10.19 |