document.selection.createRange();

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff Thies

    #1

    document.selection.createRange();

    Is there a NS7, Opera7 or Mozilla equivalent for:

    document.select ion.createRange ();

    Jeff


  • Martin Honnen

    #2
    Re: document.select ion.createRange ();



    Jeff Thies wrote:
    [color=blue]
    > Is there a NS7, Opera7 or Mozilla equivalent for:
    >
    > document.select ion.createRange ();[/color]

    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.getSelec tion();
    if (selection.rang eCount) {
    var range = selection.getRa ngeAt(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 surroundContent s and insertNode are still
    buggy with Mozilla as far as I know.

    --

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

    Comment

    Working...