FrontendDeveloper.in

JavaScript question detail

Is it possible to debug HTML elements in console

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

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

It prints the HTML element in the console,

Screenshot

Back to all JavaScript questions
Get LinkedIn Premium at Rs 399