-
Notifications
You must be signed in to change notification settings - Fork 0
/
selectEncDec.js
24 lines (22 loc) · 960 Bytes
/
selectEncDec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const selectEnc = document.querySelector(".encryptionSlct");
const checkEnc = document.querySelector("#encCheck");
const selectDec = document.querySelector(".decryptionSlct");
const checkDec = document.querySelector("#decCheck");
const handleSelectEnc = () => {
selectEnc.classList.add("selected");
selectDec.classList.remove("selected");
document.querySelector(".encryption").classList.remove("hide");
checkEnc.classList.remove("hide");
document.querySelector(".decryption").classList.add("hide");
checkDec.classList.add("hide");
};
selectEnc.addEventListener("click", handleSelectEnc);
const handleSelectDec = () => {
selectDec.classList.add("selected");
selectEnc.classList.remove("selected");
document.querySelector(".decryption").classList.remove("hide");
checkDec.classList.remove("hide");
document.querySelector(".encryption").classList.add("hide");
checkEnc.classList.add("hide");
};
selectDec.addEventListener("click", handleSelectDec);