What you're updating in your example script is the DOM value, not the HTML attribute. I admit that this might be confusing at first sight, though what you see is the expected behavior. See
comment 13 of issue 4165 for a more detailed description why.
Btw. a similar thing happens for
<textarea>. Compare the
textContent property with the
value property.
Sebastian