Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2005
    Thanked 2 Times in 2 Posts

    Question HTML/Javascript code for search?

    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.
    Last edited by vapor; 05-26-2005 at 01:40 AM. Reason: Added an example

  • #2
    Regular Coder
    Join Date
    Sep 2004
    Thanked 0 Times in 0 Posts
    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>.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts