selection object

A

Aidan

I am trying to achieve in Netscape what I can achieve in IE by
document.selection.empty(). This will remove the highlighting created by
Ctrl A or by dragging over text on a page. I can access the selection object
in NS using window.getSelection() but I have not found any way to clear it
so as to remove the highlighting. I have tried the collapse() method but
that does not do it. Any tips would be appreciated.
thanks,
Aidan
 
R

rh

Aidan said:
I am trying to achieve in Netscape what I can achieve in IE by
document.selection.empty(). This will remove the highlighting created by
Ctrl A or by dragging over text on a page. I can access the selection object
in NS using window.getSelection() but I have not found any way to clear it
so as to remove the highlighting. I have tried the collapse() method but
that does not do it. Any tips would be appreciated.

window.getSelection.RemoveAllRanges(); perhaps? See:

<url:http://www.faqts.com/knowledge_base/view.phtml/aid/7863>

../rh
 
R

rh

rh said:
window.getSelection.RemoveAllRanges(); perhaps? See:

Er, not quite. Let's make that:

window.getSelection().removeAllRanges();
as per the reference.

../rh
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top