4 function selectSpan() {
5 var selection
= window
.getSelection();
6 var range
= document
.createRange();
7 range
.setStartBefore(document
.getElementById('selectSpan'));
8 range
.setEndAfter(document
.getElementById('selectSpan'));
9 selection
.addRange(range
);
17 <span id=
"selectSpan">select this text
</span>
18 some text.. find .. find ..
20 more text findMe and text.