score:1

Accepted answer

Working demo http://jsfiddle.net/DDv8U/

rest should fit the need :)

code

$(function(){
    var div = $('div');
    $(div).append($(div).data('name'));
    $(div).data('name', ' -  Testing 2');
    $(div).append($(div).data('name'));
});

score:2

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'));
});

Related Query