Assume you have input element:
Then launch js script:
var e =
For hidden input elements, defaultValue isn't actually implemented. The reason why you get the same result ast .value
is because the browser your using is just defaulting.
See here for a discussion of this with Firefox.
The "defaultValue" property is only maintained in a way you apparently expect for "text", "file", and "password" fields.
Here is the relevant portion of the DOM spec.
I suspect the reason for this is that user activity on its own cannot change the value of hidden elements. If you want to preserve the initial values, run something at "load" or "ready" to stash the value somewhere.