-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathv1.html
40 lines (37 loc) · 850 Bytes
/
v1.html
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
<html>
<head>
<title>Selectors</title>
<style>
.output {
background-color: yellow;
margin: 10px;
}
.output1 {
width: 50px;
height: 50px;
text-align: center;
}
.output2 { padding: 10px; }
.red { background: red; }
.blue { background: blue; }
</style>
</head>
<body>
<button id="red">Red</button>
<button id="blue">Blue</button>
<div class="output output1"></div>
<div class="output output2">Lorem ipsum, ...</div>
<script
src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g="
crossorigin="anonymous"></script>
<script>
$('#red').click(function() {
$('.output').css('backgroundColor', 'red')
})
$('#blue').click(function() {
$('.output').css('backgroundColor', 'blue')
})
</script>
</body>
</html>