Dom is an input type= "text"
Use: Dom.setattribute ("Value", "2011"), can only be used by Dom.getattribute ("value") to get 2011 use: Dom.value = 2012, only through Dom.value to get 2012
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. =========== In addition, for input tags such as <input type= "text" value= "AA" >.getattribute ("value") and. Value can be obtained AA but for <div value = "AA" ></div>.getattribute ("value") gets AA and. Value gets undefined
The difference between dom.getattribute (' value ') and Dom.value