Find In Page Script
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):
Simply add the following code to your web page:
A variable contained inside allows you to specify whether the script should search current page or another frame.