# Searching for words in a text box

**URL:** <https://forum.kirupa.com/t/searching-for-words-in-a-text-box/72289>\
**Category:** Uncategorized\
**Created:** [December 4, 2004, 1:03am UTC](https://forum.kirupa.com/t/searching-for-words-in-a-text-box/72289 "2004-12-04T01:03:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![excursion](https://avatars.discourse-cdn.com/v4/letter/e/46a35a/32.png) [@excursion](https://forum.kirupa.com/u/excursion)\
**Post date:** [December 4, 2004, 1:03am UTC](https://forum.kirupa.com/t/searching-for-words-in-a-text-box/72289/1 "2004-12-04T01:03:21Z")

</div>

Hi all, hope you can help a total novice getting to grips with things.

I’m in the process of writing a page that searches a text box for matching words entered by the user. I have an input text box and a dynamic box containing a paragraph of text, if a word is typed into the input box and it also exists within the paragraph of text I would like it highlighting (in the paragraph).

So far I am struggling. I have been looking at the ‘selection’ object but I really don’t know what I should be doing with it :sigh:

Any help would be greatly apprecaited.
