Im working on a script where, when you click an image, it automatically enters the text "FOO BAR" into a form field. How can I make it so just "FOO" is highlighted when this text is entered? Here's my current code: <div> <img src="/images/file.png" name="image" onClick="sendText(document.search.q, 'FOO BAR')"> </div> Code (markup):
To elaborate, I need both words to be inserted into the form via Javascript, but only the word "FOO" to be highlighted.