[whatwg] Value attribute

Matthew Raymond mattraymond at earthlink.net
Thu Feb 24 04:27:21 PST 2005

Olav Junker Kjær wrote:
> Think of it as currentValue and defaultValue. Both exists in the DOM, 
> but only defaultValue is represented in the HTML source. The confusing 
> part is that in HTML defaultValue is called "value", while in the DOM it 
> is currentValue that is called "value".
> Anyway, editing the value of an input field does change the DOM "value" 
> attribute, but does not change the "value" content attribute in the 
> underlying HTML.

    In general, if you set a DOM property, it won't set the actual 
attribute in markup. In order to change the markup, I think you have to 
use the setAttribute method. However, I believe that the setAttribute 
method does change the DOM property.

    Internet Explorer, as I understand, completely ignores this and 
always makes a property and the corresponding attribute the same. In 
other words, IE is aspec.

More information about the whatwg mailing list