-
Notifications
You must be signed in to change notification settings - Fork 0
/
latihan1.html
85 lines (73 loc) · 2.26 KB
/
latihan1.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>jQuery - Latihan 1</title>
<style>
body {
font-family: sans-serif;
margin: 10%;
}
</style>
</head>
<body>
<div id="app">
<h1>Halo <span id="text">jQuery</span></h1>
<p>The Write Less, Do More, JavaScript Library.</p>
<button id="pesan">Ubah Tulisan</button>
<section class="main">
<nav>
<ul>
<li><a href="">Download</a></li>
<li><a href="">Blog</a></li>
<li><a href="">API Documentation</a></li>
<li><a href="">Plugin</a></li>
</ul>
</nav>
<div class="column">
<h3 class="title">Lightweight Footprint</h3>
<p>
Only 30kB minified and gzipped. Can also be included as an AMD
module
</p>
</div>
<div class="column">
<h3 class="title">CSS3 Compliant</h3>
<p>
Supports CSS3 selectors to find elements as well as in style
property manipulation
</p>
</div>
<div class="column">
<h3 class="title">Cross-Browser</h3>
<p>Chrome, Edge, Firefox, IE, Safari, Android, iOS, and more</p>
</div>
</section>
<div class="footer">
<p>© kelas.jquery - 2020</p>
</div>
</div>
<script src="js/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function () {
// Penulisan code jquery
// $('selector').action().action()
console.log(document.getElementById("text"));
console.log(document.getElementsByClassName("title"));
console.log(document.getElementsByTagName("button"));
// $('button').click(function () {
// //Ketika Tombol Diklik Lakukan Sesuatu
// $('#text').text('Word');
// });
$("#text").text("World");
$("p").css("backgroundColor", "salmon");
$(".footer p").css("backgroundColor", "aqua");
$(".title").css("textTransform", "upperCase");
$('button').mouseenter(function(){
$('#text').text('Balademy')
$('#pesan').html('<mark>Tulisan Berhasil Diubah</mark>')
})
});
</script>
</body>
</html>