Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
cheaderthecoder authored Apr 28, 2024
1 parent de364cf commit 4a61ef3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@
background-color: #007BFF;
color: #fff;
cursor: pointer;
margin: 5px;
}
</style>
</head>
<body>
<div id="converter">
<h1>Text to Base64 Converter</h1>
<textarea id="input" placeholder="Enter your text here"></textarea><br>
<button onclick="convertToBase64()">Convert</button><br>
<textarea id="output" placeholder="Your Base64 output will appear here"></textarea>
<button onclick="convertToBase64()">Convert</button>
<button onclick="deleteAll()">Delete All</button><br>
<textarea id="output" placeholder="Your Base64 output will appear here"></textarea><br>
<button onclick="copyAll()">Copy All</button>
</div>

<script>
Expand All @@ -51,6 +54,16 @@ <h1>Text to Base64 Converter</h1>
var outputText = btoa(inputText);
document.getElementById('output').value = outputText;
}

function deleteAll() {
document.getElementById('input').value = '';
}

function copyAll() {
var outputText = document.getElementById('output');
outputText.select();
document.execCommand('copy');
}
</script>
</body>
</html>

0 comments on commit 4a61ef3

Please sign in to comment.