4 ms·
From the Javascript point of view, isnt it usually better to manipulate dom object properties instead of DOM attributes?
by ufo 12y ago
From the Javascript point of view, isnt it usually better to manipulate dom object properties instead of DOM attributes?
- jbish 12y agoUsually yes. The jQuery docs[0] go into why they refactored their .attr into separate .prop and .attr methods way back when in v1.6. There are also cases, such as the value property, that will also update the value attribute. [0] http://api.jquery.com/prop/ http://api.jquery.com/prop/