How can I select the contents of an entire page using jQuery for later copying to the clipboard and therefore another WYSIWYG.
The point is this:
$("#SelectAll").click(function(){
});
Any help is appreciated.
thank
FOUND SOLUTION:
function selectAll()
var e = document.getElementsByTagName('BODY')[0];
var r = document.createRange();
r.selectNodeContents(e);
var s = window.getSelection();
s.removeAllRanges();
s.addRange(r);
}
This works in FF, which have not been tested in other browsers. You just need to call selectAll wherever I want.
source
share