ℹ️ For Any Element Applicable for input and textarea elements. Also general DOM elements: div p blockquote span strong em Et cetera. 🧑💻 Snippet /** * Copies the text content of a DOM element to the clipboard using the Clipboard API. * * Supports input, textarea, and general DOM elements (e.g., div, span). * * @param {HTMLElement} elm - The element whose content will be copied. * @throws {Error} If the argument is not an HTML element. * @throws {Error} If the Clipboard API is unavailable. * @returns {Promise<void>} Resolves when content is copied successfully. * * @example * const input = document.querySelector('input'); * await copyToClipboard(input); * * const div = document.getElementById('textContent'); * await copyToClipboard(div); */ async function copyToClipboard(elm) { const isElement = elm instanceof HTMLElement; if (!isElement) { throw new Error(`${elm} is not a DOM element.`); } cons...