Using a for..in Loop in JavaScript
<html> <head> <title>JavaScript Unleashed</title> </head> <body> <script language="JavaScript1.1" type="text/javascript"> <!-- var anObject = document; var propertyInfo = ""; for (var propertyName in anObject) { propertyInfo = propertyName + " = " + anObject[propertyName]; document.write(propertyInfo + "<br>"); } // --> </script> </body> </html>