Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


I need a way to copy to the clipboard in JavaScript?

danielm77danielm77 USAMember Posts: 72

For an web application that I'm working on, it is required to copy a text segment using JavaScript. Is it is possible to do this using JavaScript?



  • DavidMDavidM USAMember Posts: 342

    This can be achieved using a workaround since this is restricted in many browsers for a direct method. You can popup a copy box as follows.

    function copyToClipboard(text) {
      window.prompt("Copy to clipboard: Ctrl+C, Enter", text);
Sign In or Register to comment.