var form= document.createElement('form');
form.myProp = {ID:'test', Value:'someValue'};
// Following cycle doesn't see the "myProp" property
for (var p in form) {
// ...
}
// Anyway, the property is correctly accessible.
alert(form.myProp);
If I create a <div> instead of a <form> it works as expected.
What is special with forms?
Honza
<form id="f">
<input name="foo">
</form>
document.getElementById("f").foo is the <input>.
More to the point, forms have an enumerate hook which effectively
enumerates form.elements in order, as far as I can tell. I wonder
whether this is needed for web compat...
-Boris
> I wonder
> whether this is needed for web compat...
Is there any different way how to enumerate these custom properties
(to bypass the form-hook somehow)?
A bug is reported in Firebug see,
http://code.google.com/p/fbug/issues/detail?id=642
To summarize, the DOM panel doesn't show all properties of form
elements.
Honza
I suspect "no" given the current implementation, but check with .js-engine?
-Boris