Dom is an input type= "text"
Manually modifying the value of input, using Dom.getattribute ("value") can only get the value in the HTML DOM, but not the modified value (that is, the value in memory);
The most recent value (in-memory value) that can be modified by dom.value
Use: Dom.setattribute ("Value", "2011"), can only be obtained by Dom.getattribute ("value") 2011
Use: Dom.value = 2012, only 2012 can be obtained by dom.value
That is to say: GetAttribute and SetAttribute is a set, the direct use of attributes is a set, two sets of completion is not the same thing.
Summarize:
1. If it is a custom attribute, use GetAttribute, SetAttribute, and maintain browser compatibility.
2. If it is a DOM attribute, use it directly to get the latest value.
3. JQuery's underlying method $.fn.val () uses the Dom.value property.
Custom properties are best used with getattribute, SetAttribute.