vjain27
vjain27

Reputation: 3674

chrome console.log shows DOM instead of html

I have just started trying out chrome developer tools. 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. However on my system both show DOM. Even console.dirxml shows a DOM instead of html. Is this is a known issue? How can I change this behavior?

Upvotes: 0

Views: 631

Answers (1)

Alexander Pavlov
Alexander Pavlov

Reputation: 32286

If you wish to log the element's HTML, just use console.log(myElement.outerHTML).

Upvotes: 1

Related Questions