Skip to content

Commit beeacf6

Browse files
Update base64.html
1 parent 9a0a296 commit beeacf6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sc/html/base64.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,16 @@
4040
var encoded = btoa(unescape(encodeURIComponent(input)));
4141
output.innerText = encoded;
4242
}
43+
44+
document.getElementById("copy-button").disabled = false;
4345
}
4446

4547
function copyToClipboard() {
4648
var output = document.getElementById("output").innerText;
49+
if (output === "") {
50+
alert("Tidak ada teks untuk disalin!");
51+
return;
52+
}
4753
var tempInput = document.createElement("input");
4854
tempInput.value = output;
4955
document.body.appendChild(tempInput);
@@ -60,7 +66,7 @@ <h2>Base64 Decode & Encode</h2>
6066
<textarea id="text-input" placeholder="Enter text..."></textarea><br>
6167
<button onclick="encodeDecodeBase64('decode')">DECODE</button>
6268
<button onclick="encodeDecodeBase64('encode')">ENCODE</button>
63-
<button onclick="copyToClipboard()">Salin</button><br><br>
69+
<button id="copy-button" onclick="copyToClipboard()" disabled>Salin</button><br><br>
6470
<div id="output"></div>
6571
<footer style="text-align: center;">
6672
<a href="mailto:yogak@onionmail.org">yogak@onionmail.org</a>

0 commit comments

Comments
 (0)