<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="/Lecture-WEB/jquery/js/jquery-3.5.1.min.js"></script>
<script>
$(document).ready(function(){
$('#btn01').click(function(){
//$('img').before('<strong>안뇽</strong>')
//$('img').after('<strong>안뇽</strong>')
//여러 개의 형제 태그를 추가하자
$('img').after('<em>after</em>', '<b>뒤</b>')
})
})
</script>
</head>
<body>
<h1>Hello</h1>
<img src = "https://t1.daumcdn.net/daumtop_chanel/op/20170315064553027.png">
<h2>Good bye</h2>
<button id = "btn01">보튼</button>
</body>
</html>
'웹 프로그래밍 > jQuery' 카테고리의 다른 글
[jQuery] 클래스 추가, 제거하기 : addClass, removeClass (0) | 2020.06.24 |
---|---|
[jQuery] 태그 삭제하는 방법 : remove, empty (0) | 2020.06.24 |
[jQuery] 자식 태그 추가하는 방법 : append(), prepend() 함수 / appendTo(), prependTo() (0) | 2020.06.24 |
[jQuery] 세계 시간 나타내기(tooltip, 툴팁 활용) (0) | 2020.06.23 |
[jQuery] 메뉴 누르면 확대하는 애니메이션 효과 (animate) (0) | 2020.06.23 |