Javascript Reference
Categories: window

javascript window find( )

@March 15, 2008, 1:22 a.m.
find( )Firefox/Netscape/NN 4 IE n/a Chrome/Safari/DOM n/a  

find("searchString"[, matchCase[, searchUpward]])

  

Searches the document body text for a string and selects the first matching string. Optionally, you can specify whether the search should be case-sensitive or should search upward in the document. With the found text selected in Navigator 4, you can then use the document.getSelection( ) method to grab a copy of the found text. You don't, however, have nearly the dynamic content abilities afforded by Internet Explorer 4's TextRange object (for Win32). This method is disconnected in Netscape 6 (it always returns false), but is reconnected in Netscape 7.

 
Parameters
 
  • String for which to search the document.
  • Boolean value: true to allow only exact, case-sensitive matches; false (default) to use case-insensitive search.
  • Boolean value: true to search from the current selection position upward through the document; false (default) to search forward from the current selection position.
 
Returned Value

Boolean value: true if a match was found; false if not or Netscape 6 only.


Powered by Linode.