I don't believe $.fn.data is symmetric with respect to get and set. This will update an in memory cache of "data-*" values only, leaving the corresponding DOM attribute untouched.
I don't know why jq does this.
I don't know why jq does this.
Since you can't really set element attributes to non-string values, trying to sync the 'data' values with element attributes raises all sorts of unwanted problems.
To your point, performance is noble goal. Having some asymmetry is no big deal.
It's always good to know things like this.
Thanks again!
Thanks