jojuniori
9/18/2017 - 5:57 AM

https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection

function foo() {
    var selObj = window.getSelection(); 
    alert(selObj);
    var selRange = selObj.getRangeAt(0);
    // do stuff with the range
}