0

I want to Display javascript document object in webpage, in the same way it is displayed in console as object opening as dropdown. Is there any way by which we can display a javascript object on webpage without knowing its structure in the same way as console does?

asked Aug 16, 2020 at 5:32
1
  • what you have tried so far ? Commented Aug 16, 2020 at 6:04

1 Answer 1

1

Check this out:

<html>
<head>
 <script type="text/javascript">
 for(var prop in document)
 document.write(prop + ' = ' + document[prop] + '<br>');
 </script>
</head>
<body></body>
</html>

answered Aug 16, 2020 at 6:34
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.