[Greasemonkey] Grab text string in TD

Edward Lee edilee at gmail.com
Fri Apr 22 11:14:45 EDT 2005


On 4/22/05, Jeremy Dunck <jdunck at gmail.com> wrote:
> var html = document.innerHTML;
> html.replace(regexp, replace);
> document.innerHTML = html;
> 
> No?

No! But almost ;)

with (document.documentElement) {
  innerHTML = innerHTML.replace(regexp, replace);
}

Or more like the original code..
var html = document.documentElement.innerHTML;
html = html.replace(regexp, replace);
document.documentElement.innerHTML = html;

Or if you don't want to modify the head and just the body, use
document.body.innerHTML instead.

-- 
Ed


More information about the Greasemonkey mailing list