Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript get html of current page

Is it possible to get the html of the page with all modifications made by the user (see below)?

For example, if text has been entered into a textarea, or a checkbox has been chosen, that should be reflected in the html as well. My reason for wanting to do this is to take a "screenshot" of the user's page.

The answers below that are a variation of jQuery('html'), do not reflect changes made by the user.

like image 410
LanguagesNamedAfterCofee Avatar asked Jul 03 '13 15:07

LanguagesNamedAfterCofee


1 Answers

If you're wanting a screenshot, you should consider a tool such as html2canvas. Just pulling the HTML isn't going to get you the input fields.

Another SO thread along these lines.

Other answers will get you the HTML, specifically, but without the inputs' values

$('html').html();
like image 54
Richard Avatar answered Sep 27 '22 19:09

Richard