diff options
| author | mrdog233o5 <mr.dog233o5@gmail.com> | 2024-04-09 16:13:41 +0800 |
|---|---|---|
| committer | mrdog233o5 <mr.dog233o5@gmail.com> | 2024-04-09 16:13:41 +0800 |
| commit | 2057d7b23a26cfb6b4333a1f23455026563471ec (patch) | |
| tree | aa69e54ff5a436610e4f9000e3d552bd7e47b23e | |
| parent | e3ae120da9454e797f08bad8143dba4f9a0f9ff6 (diff) | |
fixed the shit
| -rw-r--r-- | main.js | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -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; }); |
