2012-11-11 81 views
5
[<h1>, prevObject: e.fn.e.init[1], context: #document, selector: "h1"] 

我如何得到結果看起來像上面?console.log在鉻看起來很奇怪的jquery元素

這是我使用的命令:console.log($('h1')); 任何人都可以得到像我一樣的結果在版本23.0.1271.64米?

+1

爲什麼你認爲這是奇怪嗎?你能指望什麼? – undefined

+0

Dupe of http://stackoverflow.com/questions/13552432/show-html-when-logging-jquery-object-in-chrome-dev-tools-console – mikemaccana

回答

3

當然,你正在尋找完整的HTML元素

使用console.log($('h1').get(0));檢查性能

或者console.log($('h1')[0]);

0

你正在尋找一個jQuery對象的所有子屬性。

如果您點擊Firefox中的+,你會看到相同的屬性..(加上所有繼承的方法

相關問題