470,821 Members | 2,068 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,821 developers. It's quick & easy.

document.selection.createRange();

Is there a NS7, Opera7 or Mozilla equivalent for:

document.selection.createRange();

Jeff
Jul 20 '05 #1
1 11497


Jeff Thies wrote:
Is there a NS7, Opera7 or Mozilla equivalent for:

document.selection.createRange();


For Mozilla if you want to manipulate the selection in a text control see
http://www.faqts.com/knowledge_base/.../13562/fid/130

If you want to manipulate the selection within text elements then
Mozilla offers the method

var selection = window.getSelection();
if (selection.rangeCount) {
var range = selection.getRangeAt(0);
}

That range object is a W3C DOM Level 2 Range object, see
http://www.w3.org/TR/DOM-Level-2-Tra...el-2-Range-idl

However the nicest methods surroundContents and insertNode are still
buggy with Mozilla as far as I know.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by George Hester | last post: by
1 post views Thread by c.anandkumar | last post: by
1 post views Thread by mikeg | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.