How to display JavaScript property of HTML element on webpage just like console.log does

  dom, html, javascript

How to display JavaScript property of HTML element on webpage just like console.log does.

<!DOCTYPE html>
<html>
<head>
  <title>Document</title>
</head>
<body>
  <button onclick="doSomething()">Click Me!</button>
</body>
</html>

Now I want to display the properties to be shown in the image below on my webpage to display as text.enter image description here

Source: Ask Javascript Questions

LEAVE A COMMENT