Expand selected text by one word
The TextRange object of IE has expand function through which you can expand the text selection to complete the word or sentence. It only works for I开发者_Python百科E. More: http://www.webreference.com/js/column12/trmethods.html
It would be great if someone can help me and make it work cross-browser.
WebKit and Firefox 4 have a modify() method of the Selection
object that does a similar job to the expand()
method of TextRanges.
精彩评论