Using $('html').html()
I can get the HTML within the <html>
tag (<head>
, <body>
, etc.). But how can I get the actual HTML of the <html>
tag (with attributes)?
Alternatively, is it possible to get the entire HTML of the page (including doctype, <html>
, etc.) with jQuery (or plain old JavaScript)?