On the previous page you replaced two occurrences of Fred but one (fred) remained. Save replace.html as case.html.
Ignoring case in searches
To find both Fred and fred you add the regular expression modifier for case insensitive search. To do that add an i after the g which is already there. No spaces or anything else just add it straight after the g. Try the case.html and all three should now be changed.
The method toLowerCase() takes the current contents of newVersion, puts all capitals to lower case and saves that back in the variable. When the alert appears there are no capitals.
Try toUpperCase as well.