I\'m trying a very simple task working with data-attr and jQuery, check this example:
Markup:
You are changing the attribute but this doesn't automatically update the data. This works:
$(function(){ var div = $('div'); div.append(div.data('name')); div.data('name', ' - Testing 2'); div.append(div.data('name')); });