Chrome Developer Tools console - inspect JavaScript object

耗尽温柔 提交于 2019-12-24 04:44:07

问题


In the old version of Chrome (not sure which version, I know it was quite some time ago), I could type the following into a console using the Chrome Developer Tools, and it would give me all associated properties of the newly created object:

document.createElement('a');

Now, when I do the same, I'm given very little back, and I can barely do anything with the returned item in the console, whereas I would just like to inspect it.

How do I view all the properties of this element, etc. as with the old version of Chrome - so I can inspect all properties and their values?

Many thanks.


回答1:


var a = document.createElement('a');
console.dir(a)


来源:https://stackoverflow.com/questions/23811256/chrome-developer-tools-console-inspect-javascript-object

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!