У меня есть следующий скрипт, но он работает только в IE, я бы хотел, чтобы он поддерживал и другие браузеры (Chrome, Firefox), но не знаю, как это сделать.Скрипт для поиска по странице Полный скрипт здесь: http://goo.gl/aEk3r - Документы Google
function performMultiSearch(elem,searchElem) {
// set up variables
var searchString; // Will hold the text to search for
var theSelection; // Will hold the document's selection object
var textNodes; // Will hold all the text nodes in the document
// Set it to search the entire document if we haven't been given an element to search
if(!searchElem || typeof(searchElem) == 'undefined') searchElem = document.body;
// Get the string to search for
if(elem && elem.value) searchString = elem.value;
else if(this && this.value) searchString = this.value;
// Get all the text nodes in the document
textNodes = findTypeNodes(searchElem,3);
// Get the selection object
if(window.getSelection) theSelection = window.getSelection(); // firefox
else { // some other browser - doesn't support multiple selections at once
alert("sorry this searching method isn't supported by your browser");
return;
}
// Empty the selection
theSelection.removeAllRanges(); // We want to empty the selection regardless of whether we're selecting anything
большое спасибо