toString() to get the currently selected text. const getSelectedText = () => window.getSelection().toString(); getSelectedText(); // 'Lorem ipsum' ...
確定! 回上一頁