A function to find and replace DOM text.