var prevSelection;
document.addEventListener('mouseup', function() {
var selection;
if (window.getSelection) {
selection = window.getSelection().toString();
} else if (document.selection) {
selection = document.selection.createRange().text;
}
if (!selection && prevSelection.length) {
alert('Text uselected');
}
prevSelection = selection;
});