<script type="text/javascript">
document.onmouseup = document.ondbclick= function(){
var txt;
if(document.selection){
txt = document.selection.createRange().text
}else{
txt = window.getSelection()+'';
}
if(txt){show(txt)}
}
function show(txt){
alert(txt)
}
</script>