USGD GYAN

10/recent/ticker-posts

USGD TECHNOLOGY GYAN IN ENGLISH function myFunction() { /* Get the text field */ var copyText = document.getElementById("myInput"); /* Select the text field */ copyText.select(); copyText.setSelectionRange(0, 99999); /* For mobile devices */ /* Copy the text inside the text field */ navigator.clipboard.writeText(copyText.value); /* Alert the copied text */ alert("Copied the text: " + copyText.value); }

How to copy a TEXT to Clipboard on a Button-Click

Hello, I'm TEXT as1



Click the following button to see the function in action

Post a Comment

0 Comments

YOU MAY ALSO LIKE