The server returns the HTML ready to display directly. End of story.
What server doing ? it uses cgi, python, etc myriad of scripts to generate html
Whats better, a button click and js in browser opens a menu, or fetching a new html with menu open