INNER CODE UNIT · JavaScript

copyText

yashab-cyber/HackGpt · website/main.js:356

function copyText(elementId, btnElement) {
    const el = document.getElementById(elementId);
    if (!el) return;

    const textToCopy = el.innerText || el.textContent;
    navigator.clipboard.writeText(textToCopy).then(() => {
        if (btnElement) {
            const originalHTML = btnElement.innerHTML;
            btnElement.innerHTML = '<i class="fa-solid fa-check text-green"></i> Copied!';
            setTimeout(() => {
                btnElement.innerHTML = originalHTML;
            }, 2000);
        }
    });
}

function copyPipeCode() {
    const codeEl = document.getElementById('pipeCode');

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…