CopyToClipboard (Both Images / Text)

javascript India
  • 13 years ago

    Hi Guys below  is the code for coping text to clipboard.

    But  i want that Both Text as well as Images should also get copied . So that i can paste them in word, officeorg, etc.

    </script>

    function copyToClipboard()

    {

    var div = document.getElementById('Popup');

     var div = document.getElementById('Popup');

     div.contentEditable = 'true';

     var controlRange;

     if(document.body.createControlRange)

     {

     controlRange = document.body.createControlRange();

     controlRange.addElement(div);

     controlRange.execCommand('Copy');

     }

     div.contentEditable = 'false';

    }

    </script>

    Any Idea/links/Suggestions . Pls Help .Its Urgent 

     

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are only 3 numbers of interest to a computer scientist: 1, 0 and infinity”