40 lines
1.5 KiB
PHP
40 lines
1.5 KiB
PHP
<?php
|
|
require_once('.htac_header.php');
|
|
?>
|
|
|
|
<section class="diZContainer diZmxAuto diZmy20">
|
|
<div class="diZMaxW600 diZmxAuto">
|
|
<h1>HTML Decoder</h1>
|
|
<div class="diZFlexColumn">
|
|
<textarea class="diZScrollBarNone" rows="10" id="encodedText" placeholder="Enter encoded HTML here..."></textarea>
|
|
<button class="diZmt4" onclick="decodeHtml()">Decode</button>
|
|
<textarea class="diZmt4 diZScrollBarNone" rows="10" id="decodedText" readonly placeholder="Decoded HTML will appear here..."></textarea>
|
|
<button class="diZmt4" id="copyButton" onclick="copyToClipboard()">Copy</button>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<script>
|
|
function decodeHtml() {
|
|
const encodedInput = document.getElementById('encodedText').value;
|
|
const textarea = document.createElement('textarea');
|
|
textarea.innerHTML = encodedInput;
|
|
const decoded = textarea.value;
|
|
document.getElementById('decodedText').value = decoded;
|
|
}
|
|
|
|
function copyToClipboard() {
|
|
const decodedText = document.getElementById('decodedText');
|
|
decodedText.select();
|
|
decodedText.setSelectionRange(0, 99999); // For mobile devices
|
|
document.execCommand('copy');
|
|
let copyButtons = document.getElementById('copyButton');
|
|
copyButtons.innerHTML = 'Copied to clipboard!';
|
|
setTimeout(() => {
|
|
copyButtons.innerHTML = 'Copy';
|
|
}, 2000);
|
|
|
|
// alert('Decoded HTML copied to clipboard!');
|
|
}
|
|
</script>
|