Get the whole document's html with JavaScript/JQuery

前端 未结 8 1138
无人及你
无人及你 2021-02-14 16:54

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

$(document).html(); returns null

8条回答
  •  礼貌的吻别
    2021-02-14 17:13

    document.documentElement.innerHTML 
    

    will return you all document markup as string

    to get the whole doctype read this

提交回复
热议问题