JavaScript document.write(): How to view the HTML?
How to view the html generated by Javascript document.write() command?
When you use the JavaScript document.write() code to output something to the browser, it does not give you a friendly way to debug your JavaScript. If you view source on the page, browser shows you the JavaScript code again; it does not show you what your document.write() results in.