Re:DOM: attributes sadness
by ufo on Tuesday August 19, 2014 @06:24PM
(#8200155)
From the Javascript point of view, isnt it usually better to manipulate dom object properties instead of DOM attributes?
[ Parent
| on HN ]
Usually 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.