From 88e2d65964dcbfd95b712cf4119e3bdf6a25e7c0 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 8 Apr 2024 22:40:54 +0800 Subject: made const before map --- main.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/main.js b/main.js index a227ac9..304e017 100644 --- a/main.js +++ b/main.js @@ -1,3 +1,9 @@ +const inputArea = document.getElementById('input'); +const outputDiv = document.getElementById('output'); +const convertButton = document.getElementById('convert'); +const modeSelect = document.getElementById('mode'); + + const map = { '`': '`', '~': '`', @@ -93,11 +99,6 @@ const map = { '?': '¿' }; -const inputArea = document.getElementById('input'); -const outputDiv = document.getElementById('output'); -const convertButton = document.getElementById('convert'); -const modeSelect = document.getElementById('mode'); - convertButton.addEventListener('click', () => { const mode = modeSelect.value; const inputText = inputArea.value; @@ -120,4 +121,4 @@ function convertNormal(data, map) { function convertReverse(data, map) { return data.split('').map(char => map[char] || char).join(''); -} \ No newline at end of file +} -- cgit v1.2.3