How to get the entire document HTML as a string?

前端 未结 15 1937
暖寄归人
暖寄归人 2020-11-22 17:00

Is there a way in JS to get the entire HTML within the html tags, as a string?

document.documentElement.??
15条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 18:02

    Use document.documentElement.

    Same Question answered here: https://stackoverflow.com/a/7289396/2164160

提交回复
热议问题