FF1+ IE5+

Find In Page Script

Author: Alan Koontz

Note: Updated June 24th, 03'- Fixed IE related bugs when searching in a frame that has navigated to a new page. Auto scroll to found phrase (in IE).

Description: This DHTML script simulates the Edit> Find In Page feature of the browser to allow your visitors to easily search for a particular text on your page. As in the "Find In Page" feature, it highlights the searched text if found, otherwise, prompts a "Not Found" message. The script:

  • Works in IE4+, NS4, Mozilla/NS7+ (not NS6), and degrades well with the rest.

  • Easily configurable to search either current page or a particular frame.

  • In IE4+, page automatically scrolls down or up if needed to where the located text is.

  • Easy repetitive search of page, by allowing a user-designated hot key to activate submit button (via ACCESSKEY attribute of HTML 4).

Demo: Type in the text you wish to locate on this page (press "Alt s" after clicking submit button to easily repeatedly search page):


Directions: Developer's View

Simply add the following code to your web page:

Select All

A variable contained inside allows you to specify whether the script should search current page or another frame.

Wordpress Users: Step by Step instructions to add ANY Dynamic Drive script to an entire Wordpress theme or individual Post