- From: Olav Junker Kjær <olav@olav.dk>
- Date: Fri, 30 Jul 2004 11:09:47 +0200
>> Oh right, so el.getAttribute('foo') and el.foo would point to >> different things in the DOM - what would el.foo='1' and >> el.setAttribute('foo',1) do to the opposite one? >> >> Seems a little unusual, and directly against 1.6.1 of DOM Level 2.0, >> but WTF, It might be a good idea, I've not really thought about it.Jim. This is actually the case with the new "form" attribute. This property/attribute is a special case, since properties corresponding to attributes usually return simple values (string, number, boolean) corresponding to the attribute value. However, the "form" property is always a reference to a HTMLFormElement, while the attribute, if specified, is a string (specifying the ID of a form-element) So the attribute might be null when the property is a HTMLFormElement (if no "form" attribute is specified in html, but the control is nested inside a form element), or reversely, the property might be null when the attribute is a string (if the string doesn't correspond to the id of a form element in the same document). This might be against section 1.6.1 If this is a problem, maybe the form attribute should be renamed? Olav Junker Kj?r
Received on Friday, 30 July 2004 02:09:47 UTC