I tried to get selected text in android on selection.It is not working in touch devices. But it is working fine in normal browsers.
if(!window.Kolich) {
Kolich = {};
}
Kolich.Selector = {};
// getSelected() was borrowed from CodeToad at
// http://www.codetoad.com/javascript_get_selected_text.asp
Kolich.Selector.getSelected = function() {
var t = '';
if(window.getSelection) {
t = window.getSelection();
}
else if(document.getSelection) {
t = document.getSelection();
}
else if(document.selection){
t =document.selection.createRange().text;
}
return t;
}
Kolich.Selector.mouseup = function(e){
var st = Kolich.Selector.getSelected();
alert(st);
}
But Android touch selection not working with this code.. please help