Properties Readonly
anchor Offset anchor Offset : number
Readonly
focus Offset focus Offset : number
Readonly
is Collapsed is Collapsed : boolean
Readonly
range Count range Count : number
Readonly
type type : string
Methods add Range add Range ( range ) : void Returns void collapse collapse ( node , offset ? ) : void Parameters node : null | Node Optional
offset : number Returns void collapse To End collapse To End ( ) : void Returns void collapse To Start collapse To Start ( ) : void Returns void contains Node contains Node ( node , allowPartialContainment ? ) : boolean Parameters Optional
allowPartialContainment : boolean Returns boolean delete From Document delete From Document ( ) : void Returns void empty empty ( ) : void Returns void extend extend ( node , offset ? ) : void Returns void modify modify ( alter ? , direction ? , granularity ? ) : void Parameters Optional
alter : string Optional
direction : string Optional
granularity : string Returns void remove All Ranges remove All Ranges ( ) : void Returns void remove Range remove Range ( range ) : void Returns void select All Children select All Children ( node ) : void Returns void set Base And Extent set Base And Extent ( anchorNode , anchorOffset , focusNode , focusOffset ) : void Parameters anchorNode : Node anchorOffset : number focusNode : Node focusOffset : number Returns void set Position set Position ( node , offset ? ) : void Parameters node : null | Node Optional
offset : number Returns void to String to String ( ) : string Returns string
A Selection object represents the range of text selected by the user or the current position of the caret. To obtain a Selection object for examination or modification, call Window.getSelection().