Highlighting Words in a Textarea with JavaScript

This script serves to demonstrate cross-browser techniques in programatically changing the selection of a textarea element. It works in Firefox, IE5+/Win, Opera 8+, Netscape 7.1+, and Safari 2.0.3+.

Demonstration


Last update: 2007-05-04