Haris
Haris

Reputation: 1059

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 IE. More: http://www.webreference.com/js/column12/trmethods.html

It would be great if someone can help me and make it work cross-browser.

Upvotes: 0

Views: 1069

Answers (1)

Tim Down
Tim Down

Reputation: 324607

WebKit and Firefox 4 have a modify() method of the Selection object that does a similar job to the expand() method of TextRanges.

Upvotes: 1

Related Questions