javascript TextRange findText( )

findText( ) NN n/a IE 4(Win) DOM n/a  

findText("string"[, searchScope][, flags])

  

Searches the current TextRange object for a match of a string passed as the required first parameter. By default, matching is done on a case-insensitive basis. If there is a match, the TextRange object repositions its start and end points to surround the found text. To continue searching in the document, you must reposition the start point of the text range to the end of the found string (with collapse( )).

 

Optional parameters let you limit the scope of the search within the range to a desired number of characters after the range's start point, or dictate additional matching requirements, such as partial or whole words.

 
Parameters
 
  • A case-insensitive string to be searched.
  • Integer for the number of characters to search relative to the range's start point. A positive number searches forward; a negative number searches backward, to text earlier in the document than the start point of the text range.
  • Integer for search detail codes: 0 (match partial words); 1 (match backwards); 2 (match whole words only); 4 (match case).
 
Returned Value

Boolean value: true if a match is found; false if unsuccessful.


2106,Nickname,Homepage or email,Comments here,Add comment