Think this is a simple question, but I am very new to web dev so I apologize :) -> on an onSelect event, how do I grab the content of what was selected? And is there a way to modify the text that was selected, such as highlighting?
This is what I have so far:
<textarea id="text">
Text to be highlighted
</textarea>
in js:
let text_selection = document.getElementById("text");
text_selection.addEventListener("select", highlightText);
function highlightText(){
alert('hello');
}