Why do you think you can put Java script into your arduino C++ code? It won't be understood by the compiler. Also you don't want it there, do you? You want this to be part of the web page, so you need to just do what you did (copied without understanding ?) for the lines above - do a client.println of those lines so that they end up in the HTML sent to the browser
Thanks for the reply, I really appreciate your help as I'm really a mechanical engineer just trying my hand at programming. I gave it a try but I'm still getting an error message (see attached), any ideas?