View Full Version : HTML/Javascript code for search?

05-25-2005, 10:23 PM
I am creating a textarea with some text in it. Is there some kind of code I can throw in my html to make the search function search the textarea and highlight the word the person searches?

<input type=text name="Search" size=20><input type="submit" value="Search">
<textarea name="Text" cols=40 rows=8>This is a test</textarea>

for example, I would type in the word test in the search line and hit search and it would highlight the word in the textbox.

06-29-2005, 03:41 PM
I would think you could have a style called span.highlight and then use php or something to go thorugh and find the word and then replace the word with <span class="highlight">word</span>.