2 function copyAndPasteNode(nodeName
) {
3 var range
= document
.createRange();
5 // Test with a single blockquote
6 var nodeToCopy
= document
.getElementById(nodeName
);
7 range
.setStartBefore(nodeToCopy
);
8 range
.setEndAfter(nodeToCopy
);
10 var sel
= window
.getSelection();
12 document
.execCommand("Copy");
14 var pasteDiv
= document
.getElementById("pasteDiv");
15 sel
.collapse(pasteDiv
, 0);
16 document
.execCommand("Paste");
18 console
.log(pasteDiv
.children
[1] == undefined
19 ? "FAILED: pasting " + nodeName
+ " DID keep the newline within the blockquote"
20 : "SUCCESS: pasting " + nodeName
+ " DID NOT keep the newline within the blockquote.");