-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjq_sample.4.html
More file actions
45 lines (39 loc) · 1.06 KB
/
jq_sample.4.html
File metadata and controls
45 lines (39 loc) · 1.06 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="js/jquery.js"></script>
<script>
$(function(){
var style_1 = {
"background-color":"#0ff",
"border":"2px solid #f00"
}
var style_2 = {
"background-color":"#ff0",
"border":"2px dashed #f00"
}
//$(".txt").siblings()
//.css(style_1);
//$(".txt + p").css(style_2);
//$(".txt").nextAll()
//.css(style_2);
$(".txt3").prevUntil(".title").css(style_1);
$(".txt3").nextUntil(".txt6").css(style_2);
});
</script>
</head>
<body>
<div id="wrap">
<h1 class="title">인접 관계 선택자</h1>
<p>내용1</p>
<p>sssss</p>
<p class="txt3">내용2</p>
<p>내용3</p>
<p>내용4</p>
<p class="txt6">ddd</p>
</div>
</body>
</html>