Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

IE9 Javascript execCommand("Copy") behavior change (new line/line breaks ignored)

$
0
0

Hi Everyone:

There has been a change in the behavior of IE9 JavaScript. The following code snippet in IE8 copies line breaks from the innerHTML/value element to the clipboard whereas IE9 ignores them.

Does anyne know why or have a solution?

Thanks in advance,

NM

 

    function copyToClipboard(field)
    {
        var content = eval("document."+field);
        content.focus();
        content.select();
        range=content.createTextRange();
        range.execCommand("Copy");
        window.status="Contents copied to clipboard";
        setTimeout("window.status=''",1800);
    }

 

 


NM

Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>