-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript-jquery.js
More file actions
69 lines (53 loc) · 1.8 KB
/
script-jquery.js
File metadata and controls
69 lines (53 loc) · 1.8 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
function validateForm() {
var nama = $("#nama").val();
var alamat = $("#alamat").val();
var umur = $("#umur").val();
var email = $("#email").val();
var password = $("#password").val();
var confirmPassword = $("#konfirmasi-password").val();
if (nama === "" || alamat === "" || umur === "" || email === "" || password === "" || confirmPassword === "") {
return false;
}
if (password !== confirmPassword) {
alert("Password yang dimasukkan tidak sama!");
return false;
}
alert("Registrasi Sukses!");
return true;
}
var passwordInput = $("#password");
function togglePassword(event, inputElement, eyeIcon) {
event.preventDefault();
if (inputElement.attr("type") === "password") {
inputElement.attr("type", "text");
eyeIcon.removeClass("fa-eye");
eyeIcon.addClass("fa-eye-slash");
} else {
inputElement.attr("type", "password");
eyeIcon.removeClass("fa-eye-slash");
eyeIcon.addClass("fa-eye");
}
}
$("#pass-toggle-btn").on("click", function(event) {
togglePassword(event, $("#password"), $("#pass-toggle-btn"));
});
// Memanggil fungsi togglePassword untuk konfirmasi password
$("#konfirmasi-pass-toggle-btn").on("click", function(event) {
togglePassword(event, $("#konfirmasi-password"), $("#konfirmasi-pass-toggle-btn"));
});
var page = window.location.pathname.split("/").pop();
$(function() {
$(".navigation li a").on("click", function() {
$(".navigation li").removeClass("active");
$(this).parent().addClass("active");
});
if(page == "index2.html") {
$(".navigation li").eq(0).addClass("active");
}
if(page == "home.html") {
$(".navigation li").eq(1).addClass("active");
}
if(page == "index.html") {
$(".navigation li").eq(2).addClass("active");
}
});