Copy to clipboard using javascript.

Technical Vandar - May 2 '22 - - Dev Community

Here is the code for copy to clipboard using pure javascript you can use this code on your project for copy something.

Code

function Copy(){
        var copyText=document.getElementById("textbox");
        copyText.select();
        copyText.setSelectionRange(0, 999);
        document.execCommand("copy");
        alert("Copied");
    }
Enter fullscreen mode Exit fullscreen mode

Using this code you can copy the content of textbox in webpage.

. . . . . . . . . . . . . . . . . . . .
Terabox Video Player