Is there any Script to search text within the displayed HTML page ?

Discussion in 'Programming' started by kslokesh, Nov 8, 2008.

  1. #1
    Is there any script to search the text within the displayed page similar to Ctrl+F Find option in the browsers..

    I have come across many users who do not have knowledge about the Find option in the browser will have difficulty to look for a particular word on a page especially when the page is too lengthy..

    So is there any script available to place a search box (or a floating find box) which just highlights the word searched for within the displayed page (similar to Find Option)..

    Any DHTML or JavaScript or Any other Language?

    Or is there any script which will invoke the Browser's Find Option so that we can put a link and invoke it like "Click Here to search within this page"..

    Any Idea?
     
    kslokesh, Nov 8, 2008 IP
  2. JWRmedia

    JWRmedia Banned

    Messages:
    499
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    In your browser toolbar > Edit > Find on this page. :)
     
    JWRmedia, Nov 8, 2008 IP
  3. Oldiesmann

    Oldiesmann Well-Known Member

    Messages:
    33
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    138
    #3
    CTRL+F (on Windows) generally works as well.
     
    Oldiesmann, Nov 8, 2008 IP
  4. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #4
    Barti1987, Nov 8, 2008 IP
  5. kslokesh

    kslokesh Well-Known Member

    Messages:
    153
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #5
    Wow.. Thanks azizny.. This is a good one.. But where can we download the script? This is a helpful one..

    It would have been more better if the script could navigate through the highlighted words on the page similar to "Ctrl+F" Find..

    Really a good script.. Can we edit it to use a different color for highlighting the subsequent search terms?

    I am very new to HTML and Javascript..
     
    kslokesh, Nov 9, 2008 IP
  6. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #6
    Right Click -> View source.

    However, you need to know Javascript to play with it.

    Peace,
     
    Barti1987, Nov 9, 2008 IP