Santhosh
Santhosh

Reputation: 20416

document.selection in Javascript

I need to know what is the use of following code:

var obj=document.selection.createRange();
obj.moveStart('character', count);

From what I understand, obj will have the selected text.

What is moveStart is used for..?

Upvotes: 0

Views: 644

Answers (1)

KiNgMaR
KiNgMaR

Reputation: 1567

According to MSDN (http://msdn.microsoft.com/en-us/library/ms536623%28VS.85%29.aspx), that call moves the start of the selection by count characters to the right.

Obj will not be a string by the way, it'll be a TextRange object instance: http://msdn.microsoft.com/en-us/library/ms535872%28VS.85%29.aspx#

Upvotes: 2

Related Questions