注意大小写
var r = document.selection.createRange();
alert(r.text);

解决方案 »

  1.   

    请问一下,这个函数createRange() 的用法手册 在哪里可以找到 搜索到的都不是这个函数的用法
      

  2.   

    当年我自己做html编辑器的时候就是看着chinaren校友录的多彩留言代码和msdn的资料做的
      

  3.   

    http://vip.5d.cn/friday/upload/HTMLREF.chm
      

  4.   

    MSDN
    selection Objectclear  Clears the contents of the selection. 
    createRange  Creates a TextRange object from the current selection. 
    createRangeCollection  Creates a TextRange object collection from the current selection. 
    empty  Deselects the current selection, sets the selection type to none, and sets the item property to null. 
    TextRange  Retrieves a collection of TextRange objects. 
    time2  Provides an active timeline for an HTML element or group of elements. 
    type  Retrieves the type of selection. 
    typeDetail  Retrieves the name of the selection type.