When creating websites I often use jQuery\'s .data()
function to add data to elements.
Is it possible to view all data which is stored with an element in Ch
For this reason, I don't use the $(selector).data()
pattern, and, instead I use a more HTML natural $(selector).attr('data-name','value')
which adds the values to the actual HTML.
$(selector).attr('data-name','value')
does not work in IE8+ browsers. .data()
is preferred. Also, a user defined var such as say: data-name
is not an attribute in HTML.