This is something that’s been driving me nuts for a while. When I console.log a DOM node (returned by example from document.getElementById), it appears as an interactive html element, as it would appear on the “Elements” tab.
This can be handy for sure, but there are times when I just want to be able to expand the object and see all of its properties, like I can do for every other kind of object I log to the console.
Is there any way I can get a DOM node to display in the console as a regular object??
Use
console.dirinstead ofconsole.log.From the Firebug docs:
Chrome supports
console.diras well, as shown here (not shown as a property ofconsole, but it is available).