-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjq_sample.5.html
More file actions
47 lines (41 loc) · 1.04 KB
/
Copy pathjq_sample.5.html
File metadata and controls
47 lines (41 loc) · 1.04 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
46
47
<!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 #00f"
}
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);
$(".txt1").parents().css(style_1);
$(".txt2").parents("div").css(style_2);
});
</script>
</head>
<body>
<h1 class="title">선택자</h1>
<section>
<div>
<p class="txt1">내용1</p>
</div>
</section>
<section>
<div>
<p class="txt2">내용2</p>
</div>
</section>
</body>
</html>