Ho risolto così:

codice:
    var txtarea = document.getElementById("note");
    var inizio = txtarea.selectionStart;
    var fine = txtarea.selectionEnd;
    var sel = txtarea.value.substring(inizio, fine);
    alert(sel+" inizio="+inizio+" fine="+fine);
dove 'note' è l'id della textarea