Of course, there are many more ways to highlight text (or technically speaking, implement the Javascript select() function). The following examples are only a sample of the ways you can use this, be creative and you could modify these codes to add some interesting and practical features to your site.
Example 2
Hit the button to highlight the code and move the focus to the box.
Example 3
Move the cursor over the textarea to highlight the code.
Example 4
Move the cursor over the textarea to highlight the code and move the focus to the box.
Example 5
Hit the button to highlight the words in the text box.
Example 6
Hit the button to highlight the words and move the focus to the text box.
Example 7
Move the cursor over the text box to highlight the words.
Example 8
Move the cursor over the text box to highlight the words and move the focus to the box.
by NESGamepro - nescgi.com