groups

name language licence
SearchInWindow JavaScript Other
JavaScript Compressor - JavaScript JavaScript GPL 2
Up2five.js JavaScript Other
jsPathto.js JavaScript Other
extracontent.jq.min.js JavaScript Other
sdSetHeight JavaScript Other
Rotating PageHeader JavaScript Other
Test for jQuery JavaScript Other

< 1 2 3 4 5 >



language: JavaScript
licence: Other

SearchInWindow

options: view full snippetsend to code collector
/*
Question: How do I search for a particular text string on the page?

Answer: In several browsers (Netscape Navigator, Firefox, Google Chrome), to search for a string programmatically, you can use the window.find(string) method; see also Find Dialog. Internet Explorer does not support this method. However, in Internet Explorer 4.x and newer, you can create a text range object (TRange in the example below) and use the method TRange.findText(string).

Example: The following script gets a text string from the user and then finds and highlights this string on the page. 
 
This example has been created using the following code:
*/

var TRange=null

function findString (str) {
 if (parseInt(navigator.appVersion)<4) return;
 var strFound;
	
(Continues...)