I have
<div data-text="This is a text">...</div>
I need to access the data-text in javascript.
It works with alert($('div').data('text')); but not with alert($.data($('div'), 'text')); gives me undefined.
WHY?
LINK: http://jsfiddle.net/tvDzP/2/
(For performance issues I use element.attr('data-text') to retrieve the text )