Demo of the bililiteRange package. Type in the three text boxes and select parts of the page and see what is reported in the bottom row.

Force selection of specific characters with the Set Selection buttons (characters are indexed from 0 at the start of the string), or replace characters with the Replace button. Insert a newline with the Insert Break button.

The package can deal with browsers that do not support selections and text ranges, but trying to find such a browser is hard, so the "Force selection-not-implemented" checkbox makes the program pretend that they are not supported.

Try this in different browsers. It's been tested in Internet Explorer 8, Firefox 3.6, Safari 5.03, Opera 10.63, and Chrome 8.

<input> <textarea> <div>
to to to
to with to with to with
at position at position at position
Selection is undefined, undefined to undefined. Selection is undefined, undefined to undefined. Selection is undefined, undefined to undefined.