Question: How do I invoke the browser's Find dialog from JavaScript?
Answer:
In Netscape Navigator, Firefox and some other browsers (but not in Internet Explorer!)
you can call the window.find()
method without parameters to invoke the browser's Find dialog. Try it now:
<form>
<input type=button value="Find (Netscape/Firefox/etc)"
onClick="if (window.find) window.find();
else alert('Your browser does not support \'window.find()\'!')
">
</form>
Internet Explorer does not support
window.find().
However, in most modern browsers including Internet Explorer,
you can write a script that finds a user-defined string on the page.
For more information on this technique, see
Searching for text.
See also other JavaScript dialogs:
Copyright © 1999-2009, JavaScripter.net.