It's now working. At first it wouldn't, though. After the last test I erased everything from local and server and started all over again, using all the precautions you mentioned. And at first that didn't work either so I did it all again, this time copying my code from the existing page onto the premade one, instead of the other way around, just in case, and that last time it worked perfectly. It must have been just the BOM code in concert with some hidden anomaly, perhaps caused by a fault in copying or pasting. Not 100% sure, but that's what I think. As I say, it now works as it should.
Thanks, Eric, be well :)