简体   繁体   English

chrome console.log显示DOM而不是html

[英]chrome console.log shows DOM instead of html

I have just started trying out chrome developer tools. 我刚刚开始试用chrome开发人员工具。 According to the chrome official website logging an element using console.log should show the html while console.dir should show the DOM on console. 根据chrome官方网站记录,使用console.log的元素应显示html,而console.dir应在console上显示DOM。 However on my system both show DOM. 但是在我的系统上都显示DOM。 Even console.dirxml shows a DOM instead of html. 甚至console.dirxml显示DOM而不是html。 Is this is a known issue? 这是一个已知问题吗? How can I change this behavior? 我该如何改变这种行为?

如果您希望记录元素的HTML,只需使用console.log(myElement.outerHTML)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM