Copy image to Clipboard not working in Firefox & Chrome


Sajin Sasidharan

I need one help regards JavaScript. I used this script in
website to copy image in an image control on button click.

<script type="text/javascript">
function CopyToClip() {
var imgControl =
imgControl.contentEditable = 'true';
var controlRange;

if (document.body.createControlRange) {
controlRange = document.body.createControlRange();
imgControl.contentEditable = 'false';
return true;

This code for copying image (which is in an image control) to
clipboard and it works fine in IE.

But this script is not working in Firefox & Chrome.

Please suggest any good solution to work in Firefox & Chrome

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question