R
Rob
Hello all
Is it possible to get which text in a textarea element is selected ?
If so How?
Thanks Rob
Is it possible to get which text in a textarea element is selected ?
If so How?
Thanks Rob
Rob said:Is it possible to get which text in a textarea element is selected ?
The function below returns any selected text (in IE, Netscape and iCab). Or
if no text is selected, null is returned. You have to do additional tests to
see if it is in the textarea. You should call this function onmousedown and
not onclick, because that may unselect the selection.
function isselect(){
if((d=document).getSelection)return d.getSelection();
if(d.selection && d.selection.createRange)return
d.selection.createRange().text;
return false;
}
Rob said:Hello all
Is it possible to get which text in a textarea element is selected ?
If so How?
Thanks Rob
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.