Restore Text Selection from a Range

307 views Asked by At

I have a range object created by Rangy in Javascript. Now i want to Restore the text from this Range object.

E.g range= WrappedRange {nativeRange: Range, commonAncestorContainer: div.ng-scope, collapsed: false, endOffset: 19, endContainer: text…}

Need help with how can i do it ...?

1

There are 1 answers

0
Tim Down On BEST ANSWER

I think you need

var sel = rangy.getSelection();
sel.setSingleRange(range);