-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
70 lines (59 loc) · 1.7 KB
/
Copy pathscript.js
File metadata and controls
70 lines (59 loc) · 1.7 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
70
const menutoggle = document.querySelector(".menu-toggle input");
const nav = document.querySelector("nav ul");
const beranda = document.querySelector(".beranda");
const processor = document.querySelector(".processor");
const motherboard = document.querySelector(".motherboard");
const ram = document.querySelector(".ram");
const storage = document.querySelector(".storage");
const contact = document.querySelector(".contact");
const pesan = document.querySelector(".cart");
const email = document.getElementById("email");
const nama = document.getElementById("nama");
const txtarea = document.getElementById("txtarea");
function cek() {
var cb = document.getElementById("cek");
cb.checked = false;
}
function kosongkandata() {
email.value = "";
nama.value = "";
txtarea.value = "";
}
function kirim() {
if (email.value === "" || nama.value === "" || txtarea.value === "") {
alert("Silahkan lengkapi form terlebih dahulu !");
} else {
alert("Berhasil dikirim");
kosongkandata();
}
}
function add() {
alert("Berhasil ditambahkan kekeranjang");
}
menutoggle.addEventListener("click", function () {
nav.classList.toggle("slide");
});
beranda.addEventListener("click", function () {
nav.classList.remove("slide");
cek();
});
processor.addEventListener("click", function () {
nav.classList.remove("slide");
cek();
});
motherboard.addEventListener("click", function () {
nav.classList.remove("slide");
cek();
});
ram.addEventListener("click", function () {
nav.classList.remove("slide");
cek();
});
storage.addEventListener("click", function () {
nav.classList.remove("slide");
cek();
});
contact.addEventListener("click", function () {
nav.classList.remove("slide");
cek();
});