Chrome开发者工具控制台

Chrome开发者工具控制台

本文介绍了Chrome开发者工具控制台-检查JavaScript对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在旧版本的Chrome(不确定是哪个版本,我知道它已经有很长时间了)中,我可以使用Chrome开发者工具在控制台中输入以下内容,这将为我提供新版本的所有相关属性创建的对象:

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.

与旧版本的Chrome一样,如何查看此元素的所有属性,以便可以检查所有属性及其值?

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?

非常感谢.

推荐答案

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

这篇关于Chrome开发者工具控制台-检查JavaScript对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 11:39