Replying to [comment:1 rwaldron]:
data() functionality existed long before
dataset and has it's own semantic behaviour to adhere to, and it's expected to be fast. A DOM operation will slow it down tremendously (as well as having no effect in browsers that don't support it).
I understand what you are saying about the data() functionality, and I use the data() functionality as well, and it is a nice. I like it, but it is not the optimal solution for what I need to do, nor does it really have anything to do with this topic.
I'm talking about the attr() function, which does work as expected if an attribute is already set for the DOM node, as noted above. Which would imply that attr() is already modifying the DOM.
I was reporting it to be a good citizen, but it is good to know you have no intentions of fixing it, so I'll just make it policy to not use the attr method and instead use the native setAttribute method on the dom node, no big deal to me, I didn't bang my head on the issue that long.