sAMPLE jAVA sCRIPT cOPY ON CLICK
<!DOCTYPE html> <html> <head> <style> </style> <script src="https://stacksnippets.net/scripts/snippet-javascript-console.min.js?v=1"></script> </head> <body> <p onclick="copy(this)">hello man</p> <script type="text/javascript"> function copy(that){ var inp =document.createElement('input'); document.body.appendChild(inp) inp.value =that.textContent inp.select(); document.execCommand('copy',false); inp.remove(); } </script> </body> </html>
0 comments:
Post a Comment