Skip to content

Commit 1ac4065

Browse files
Update base64.html
1 parent c7959b3 commit 1ac4065

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sc/html/base64.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
var output = document.getElementById("output");
2525

2626
if (action === "decode") {
27-
var encoded = btoa(unescape(encodeURIComponent(input)));
28-
output.innerHTML = encoded;
29-
} else if (action === "encode") {
3027
try {
3128
var decoded = decodeURIComponent(escape(atob(input)));
32-
output.innerHTML = decoded;
29+
output.innerText = decoded;
3330
} catch (error) {
34-
output.innerHTML = "Invalid Base64 input";
31+
output.innerText = "Invalid Base64 input";
3532
}
33+
} else if (action === "encode") {
34+
var encoded = btoa(unescape(encodeURIComponent(input)));
35+
output.innerText = encoded;
3636
}
3737
}
3838

0 commit comments

Comments
 (0)