Reputation: 317
I am trying to see the HTML that's created by a JavaScript snippet on my HTML page by viewing the page source. I don't want to use any add-on programs. Is this possible through programming?
Upvotes: 4
Views: 6592
Reputation: 1050
To do this with Safari 13 (2019) on the Mac:
No plugin or additional software required (and some other nice tools there too).
Upvotes: 1
Reputation: 482
I'm 8 years late but I made a Chrome extension to do just this:
It shows the raw HTML and the rendered DOM, and compares the diff between the two.
Upvotes: -1
Reputation: 615
Here is my favorite solution in IE (version 10):
1) Press F12 key to launch Developer Tools
2) Click on the "Console" tab
3) In prompt at the bottom, enter:
document.body.innerHTML
Now it should display in the current window the dynamic, current, generated html. (To look at the html head section instead you can replace the word 'body' with 'head'.)
Upvotes: 1
Reputation: 37506
In firefox, do ctrl/command-a to select all, right click and do "view selection source." That'll show the DOM for the page as it currently is rather than just whatever HTML and JS it started from.
Upvotes: 3
Reputation: 63802
Press F12 in most browsers to bring up the developer tools.
Search for tutorials for the various developer tools of the browser of your choice.
Upvotes: 0
Reputation: 39389
No. You need a tool that monitors changes to the DOM. Browsers will only show you the mark-up unaffected by JavaScript or any other client-side programming.
Use WebKit's Web Inspector or other similar tool.
Upvotes: 0