Javascript Element How to - Get all document properties








Question

We would like to know how to get all document properties.

Answer


<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type='text/javascript'>
$(window).load(function(){<!--from   www.  ja v  a2 s  . c  om-->
    for (var name in document) {
        if (!!document[name] === false) {
            $('#foo').append('document.' + name + '<br />');        
        };
    };
});
</script>
</head>
<body>
  <div id="foo"></div>
</body>
</html>

The code above is rendered as follows: