copy text button function in javascript code example Example: jquery copy to clipboard document.execCommand("copy");