Getting Selected Text from a Textarea Through Javascript in Safari
Is not possible. Will update this post if shown to be incorrect.
How it’s done in IE:
document.selection.createRange().text will contain your selected text.
How it’s done in Mozilla/Firefox:
//Get the textbox through the DOM
var txta = document.getElementById(’txt’);
//this will contain your selected text
txta.value.substring(txta.selectionStart, txta.selectionEnd));
How it’s done in Safari:
Call Dave Hyatt and ask him what’s selected.
