summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrdog233o5 <mr.dog233o5@gmail.com>2024-04-09 16:13:41 +0800
committermrdog233o5 <mr.dog233o5@gmail.com>2024-04-09 16:13:41 +0800
commit2057d7b23a26cfb6b4333a1f23455026563471ec (patch)
treeaa69e54ff5a436610e4f9000e3d552bd7e47b23e
parente3ae120da9454e797f08bad8143dba4f9a0f9ff6 (diff)
fixed the shit
-rw-r--r--main.js12
1 files changed, 2 insertions, 10 deletions
diff --git a/main.js b/main.js
index 7c1e830..42895b4 100644
--- a/main.js
+++ b/main.js
@@ -90,7 +90,7 @@ MÂ
<¯
>˘
?¿`.split("\n");
-const modeBtn = document.getElementById("modeBtn");
+const modeBtn = document.getElementById("mode");
const convertBtn = document.getElementById("convertBtn");
const input = document.getElementById("input");
const output = document.getElementById("output");
@@ -120,16 +120,8 @@ function convert(input, mode) {
return result;
}
-modeBtn.addEventListener("click", () => {
- mode = !mode;
- if (mode) {
- modeBtn.innerText = "normal text > encrypted text";
- } else {
- modeBtn.innerText = "encrypted text > normal text";
- }
-});
-
convertBtn.addEventListener("click", () => {
+ mode = modeBtn.value == "0" ? true : false;
var res = convert(input.value, mode);
output.innerText = res;
});