

DOM: attributes sadness - bpierre
http://annevankesteren.nl/2014/08/attributes

======
colanderman
The sarcasm is annoying and obscures and cheapens the point you're trying to
make.

If the point is good, it will stand on its own. Excess sarcasm just comes off
as a crutch.

~~~
earp
We didn't like how attributes worked, so we changed it, but then people were
using it and now we have to change it back. It's not a particularly good
point. I would like to know more about the fundamental problem with existing
specs. I've never had a problem with attributes that couldn't be fixed in
browser implementation rather than specification, certainly not a "problem"
that could only be solved with React or jQuery as suggested in comments. I
thought that specs nowadays are modeled after "what works in todays browsers"
rather than "what would be better", much like HTML5 is modeled after what
works in IE6 (talking about "brave enough"). I also thought that this proposed
simplification is already part of DOM4, or did I make that up? Should
namespaced attributes simply become unsupported on an API level? That's a cost
to pay, much like querySelector comes with the cost of 1) only being able to
query the document structure downwards, not upwards, and 2) only being able to
query the default namespace. The API may be less awkward, but it introduces
problems that are _actually_ problematic, so more arguments would come in
handy for me to understand the point.

------
skybrian
This seems like reason enough to prefer using a virtual DOM.

~~~
sehr
Excuse me sir, have you accepted our lord and savior React.js into your life?

~~~
argonaut
The only thing you need to solve this specific problem is jQuery.

------
ufo
From the Javascript point of view, isnt it usually better to manipulate dom
object properties instead of DOM attributes?

~~~
jbish
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.

[0] [http://api.jquery.com/prop/](http://api.jquery.com/prop/)

