Working on some random jQuery this weekend I noticed something about data-attributes that I hadn't before. Apparently jQuery's .data() function tries to coerce any number like value into an actual JS number object. This means data-whatever="0000" turns into whatever=0 in the .data() object. So, it is advised to use .attr() whenever you need to get the true value of an attribute.
15 Jul 2012