You are not being serious, right?
1.410 === 1.41
1.410 === 1.41
<div id="test" data-foo="1.1">
$('#test').data('bar', '1.1');
typeof $('#test').data('foo'); // number
typeof $('#test').data('bar'); // string
If the data-foo value is user input, then converting it to a number might not be expected. E.g. <div data-emoticon="0.0" /> elem.data('foo', { 'a':1, 'b':2 });
elem.data('foo'); // Returns the object
Is certainly more desirable than: elem.attr('foo', { 'a':1, 'b':2 });
elem.attr('foo'); // Returns "[object Object]"