Skip to content

Display Javascript Object In WebPage Without Knowing Its structure

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?



Check this out:

    <script type="text/javascript">
        for(var prop in document)
            document.write(prop + ' = ' + document[prop] + '<br>');
User contributions licensed under: CC BY-SA
7 People found this is helpful