window.getSelection retornar html [duplicado]

Esta pergunta já tem uma resposta aqui:

HTML do texto selecionado 1 resposta
function selected() {
   var selObj = window.getSelection();
}


Esta função retorna o texto selecionado de uma página da web. Como retornar ohtml de uma área selecionada. Isso é possível com um<img> e um<a> etiqueta, rótulo, palavra-chave?


Aqui está a lista de funções:
https://developer.mozilla.org/Special:Tags?tag=DOM&language=en

questionAnswers(1)

yourAnswerToTheQuestion