WIP: selText

This commit is contained in:
Sebastian Titz 2022-07-14 09:01:28 +02:00
parent 7834004380
commit 240a1f999a

13
selText.js Normal file
View File

@ -0,0 +1,13 @@
$(function(){
$(document.body).bind('mouseup', function(e){
var selection;
if (window.getSelection) {
selection = window.getSelection();
} else if (document.selection) {
selection = document.selection.createRange();
}
selection.toString() !== '' && alert('"' + selection.toString() + '" was selected at ' + e.pageX + '/' + e.pageY);
});
});