Do you want to save it to your server, or on the client's drive? You could have your JavaScript put the page's modified HTML content into a hidden form variable, and submit the form to the server where you could use PHP or something else to save the file. It sounds a little risky, though - be careful.
-Keegan