summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-04-09 16:24:31 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-04-09 16:24:31 +0800
commitcd7c2e8089dc4cf36a4e66107539c2d5d3af1b39 (patch)
tree2841146e5039078bc33f22657082a35cfa71f070
parent2057d7b23a26cfb6b4333a1f23455026563471ec (diff)
reverse normal mode and reerse mode
changed eventlistner to .on = event
-rw-r--r--main.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/main.js b/main.js
index 42895b4..4d6c037 100644
--- a/main.js
+++ b/main.js
@@ -120,12 +120,12 @@ function convert(input, mode) {
return result;
}
-convertBtn.addEventListener("click", () => {
- mode = modeBtn.value == "0" ? true : false;
+convertBtn.onclick = event => {
+ mode = modeBtn.value == "0" ? false : true;
var res = convert(input.value, mode);
output.innerText = res;
-});
+}
-copyBtn.addEventListener("click", () => {
+copyBtn.onclick = event => {
navigator.clipboard.writeText(output.innerText);
-}); \ No newline at end of file
+} \ No newline at end of file