[Home] > Snippets  > Browser  > DOM  >  Get the selected text

Get the selected text

JavaScript

const getSelectedText = () => window.getSelection().toString()