how to copy text by js code example
Example 1: copy text to clipboard javascript
//As simple as this
navigator.clipboard.writeText("Hello World");
Example 2: js copy text to clipboard
function copy() {
var copyText = document.querySelector("#input");
copyText.select();
document.execCommand("copy");
}
document.querySelector("#copy").addEventListener("click", copy);