Page 1 of 1

Can't use object properties' values

Posted: Tue Aug 08, 2006 3:53 am
by pilau
Hi.
I'm succesfully fetching an img element by it's ID, but I can't any of the properties' values, not even the id property.
I tried it both in Firefox and IE6 but to no avail.

Please help me solve this issue.

Code: Select all

// fetch_object emulates document.getElementById
// and bridges over browser compatibility (it works, the problem is not here)

var buttonIcon = fetch_object(obj.id + '_icon');
alert(buttonIcon.id);
The fetching works, but again, I can't get any of the properties' values so the alert function isn't functioning. What's even more weird, I tried the following code and it worked:

Code: Select all

for (property in buttonIcon)
{
   alert(proprty + "<br>");
}
All of the properties' names were printed out. I think I am going crazy. Why can't I get the properties values?