you would have to use a scripting language like javascript or PHP in order to do that, not just HTML.
you'll need to parse the entire text of the page and put it into an array and search for the string "test" and for each instance that it occurs, replace it with "ok".
You can probably find some scripts that do that on just about any javascript or php site.