Highlight Within Textarea jQuery Plugin Demos

Using Array

Your onInput callback can return an array of arrays to specify highlights by character position. Each inner array has 2 values: a starting index (inclusive) and an ending index (exclusive). This example highlights the first 30 characters, 10 characters at a time.

Using Regex

The onInput callback can also return a regex. This example simply highlights all numbers.

Using Regex Again

Another common use case is to highlight from a list of 1 or more strings. This is easily done with regex. This example highlights certain country names.