July 1998
Intermediate to advanced
1456 pages
65h 5m
English
expand( ) — NN n/a IE 4 DOM n/a
expand(unit)
Expands the current text range to encompass the textual unit passed as a parameter. For example, if someone selects some characters from a document, you can create the range and expand it to encompass the entire sentence in which the selection takes place:
var rng = document.selection.createRange( )
rng.expand("sentence")If the starting range extends across multiple units, the
expand( ) method expands the range outward to the
next nearest unit.
Boolean value: true if method is successful;
false if unsuccessful.
unit
A case-insensitive string value of the desired unit:
character | word |
sentence | textedit. The
textedit value expands the range to the entire
original range.
Read now
Unlock full access