Hi
Here's a modified version that I've been using to highlight search words. As with the other examples, this is IE specific.
function dohigh(thetext){
var r = document.body.createTextRa
while(r.findText(thetext))
r.execCommand('ForeColor',
r.moveStart('character',th
r.moveEnd('textedit');
}
}
All it does is find the first match in the textrange, change the forecolor to red then change the range to begin after the item just found, and carries out the search again until no match is found.
Hope it helps!
scrollo
Main Topics
Browse All Topics





by: hongjunPosted on 2002-08-25 at 04:45:26ID: 7241476
See this m/dynamici ndex11/fin dpage.htm
http://www.dynamicdrive.co
hongjun