Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
65
rated 0 times [  69] [ 4]  / answers: 1 / hits: 16054  / 12 Years ago, thu, january 31, 2013, 12:00:00

I know it's already discussed here, but there were no solution to get the whole document (including doctype).



$(document).html(); returns null...


More From » jquery

 Answers
22

This will get you all the HTML:



document.documentElement.outerHTML


Unfortunately it does not return the doctype. But you can use document.doctype to get it and glue the two together.


[#80502] Wednesday, January 30, 2013, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ryderalfonsos

Total Points: 655
Total Questions: 88
Total Answers: 91

Location: Nauru
Member since Thu, Feb 2, 2023
1 Year ago
;