Re:Don't use the jQuery .data() method. Use .attr() instead.
by glenjamin on Sunday December 18, 2011 @05:41PM
(#3367735)
In what way does the author think this behaviour is wrong?
1.410 === 1.41
If he wanted to store a string, then he should actually store a string. .data() is just a thin wrapper around getting and setting values on an object, which initialises its initial values from the data-* attributes on the element in question (which should always be strings).
If he wanted to store a string, then he should actually store a string. .data() is just a thin wrapper around getting and setting values on an object, which initialises its initial values from the data-* attributes on the element in question (which should always be strings).