--- title: Document.getSelection() slug: Web/API/Document/getSelection translation_of: Web/API/DocumentOrShadowRoot/getSelection translation_of_original: Web/API/Document/getSelection original_slug: Web/API/DocumentOrShadowRoot/getSelection ---

{{APIRef("DOM")}}

Esse método funciona de forma idêntica ao método {{domxref("Window.getSelection()")}};  Ele retorna um objeto {{domxref("Selection")}} representando o texto atualmente selecionado no documento.