W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2005

[whatwg] Value attribute

From: Matthew Raymond <mattraymond@earthlink.net>
Date: Thu, 24 Feb 2005 07:27:21 -0500
Message-ID: <421DC829.5090505@earthlink.net>
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.
Received on Thursday, 24 February 2005 04:27:21 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:39 UTC