Neither html nor javascript has the ability to write to a file, let alone write to the client's machine. The only exception is writing a cookie, and storing an entire html page as a cookie may be possible, but highly inefficient. The only possibility I can think of is write your html page, display it, and pop a window that prompts the user to use his browser's File-Save manually.
Where as you can not save or edit files on the clients machine doesn't mean you have to give up your quest of wanting to do this. If you have the ability of serverside scripting, you can have the file created there and when the client wants to get the file you can display a page that has there recently created page/file in a link so they can download it where they please
Bookmarks