copy div data that contains grid view
<p>I m implementing copy to clipboard functionality for div that contains asp.net gridview.
my code is working on i.e only now how can i make it for all browsers</p>

<pre><code>function CopyGridView() {

       var div = document.getElementById('div1');                  
       div.contentEditable = true;
       var controlRange;
       if (document.body.createControlRange) {
           controlRange = document.body.createControlRange();
           controlRange.addElement(div);
           controlRange.execCommand('Copy');
       }
                  div.contentEditable = 'false';
}
</code></pre>

<p>Please help.     </p>

<p>Regards,<br>
-Nitin</p>
