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
Satish Chandra Gupta
3,4311 gold badge25 silver badges24 bronze badges
-
what you have tried so far ?KcH– KcH2020年08月16日 06:04:39 +00:00Commented Aug 16, 2020 at 6:04
1 Answer 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
gpl
1,5112 gold badges11 silver badges26 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
Explore related questions
See similar questions with these tags.
default