-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathkomparasi-1.html
46 lines (33 loc) · 1.2 KB
/
komparasi-1.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Komparasi 1 Vanilla JS / JQuery / Alpine JS</title>
<!-- Include JQuery Lib -->
<script src="https://code.jquery.com/jquery-3.6.3.js" integrity="sha256-nQLuAZGRRcILA+6dMBOvcRh5Pe310sBpanc6+QBmyVM=" crossorigin="anonymous"></script>
<!-- Include Alpine JS Lib -->
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.10.5/dist/cdn.min.js"></script>
</head>
<body>
<p class="px-2"><a href="https://github.com/pemrogrammer/kelas-alpinejs-2023/1-pengenalan/a-komparasi/komparasi-1.html" target="_blank"> 🥵 source code</a></p>
<!-- Vanilla -->
<button id="btnVanilla">Vanilla JavaScript</button>
<!-- JQuery -->
<button id="btnJQuery">JQuery</button>
<!-- Alpine JS -->
<button x-data x-on:click="alert('Alpine JS')">Alpine JS</button>
<script>
// Vanilla Javascript
document.getElementById("btnVanilla").addEventListener("click", function () {
alert("Vanilla JavaScript");
});
// JQuery
$("#btnJQuery").click(function () {
alert("JQuery");
});
// Alpine JS
</script>
</body>
</html>