If I select with the mouse contents from any web page, copy them to the clipboard and then paste them on an email editor (e.g., Gmail) I get all sort of rich contents copied, like styles, images, etc.
I would like to do the same kind of rich content selection, but with javascript.
More specifically, I would like to select with javascript all contents inside a div
in a web page I own, so that the user just has to press Ctrl+C and then paste the contents on an email editor.
Is there a way to do that? How?