I am a newbee with javascript and have the following code:
<html>
<body>
<object classid="clsid:f6D90f11-9c73-11d3-b32e-00C04f990bb4" id="abc">
</object>
<script>
var b=document.getElementById("abc");
for (a in b){
document.write(a+"<br>");
}
alert(b.object);
</script>
</body>
</html>
Now, my question is why doesnt this code enumerates all the properties for the object b.
And to be more specific, this code does not enumerates the “object” property. But the code alert(b.object) tells me that this is an object.
Am I doing everything right? can someone clarify my doubts.
Thanks
To enumerate all properties (both own or inherited, both enumerable or non-enumerable) of an object, do this:
Live demo: http://jsfiddle.net/L899Z/3/