JS Coding Questions Logo
JS Coding Questions
#374💼 Interview💻 Code

Is it possible to debug HTML elements in console

Advertisement

728x90

Yes, it is possible to get and debug HTML elements in the console just like inspecting elements.

javascript
1const element = document.getElementsByTagName("body")[0];
2
3console.log(element);

It prints the HTML element in the console,

Screenshot

Advertisement

Responsive Ad
🎯 Practice NowRelated Challenge

JavaScript Coding Exercise 32

Test your knowledge with this interactive coding challenge.

Start Coding

Advertisement

728x90
374of476