A couple of notes: if you care about performance, use $.data(), i.e. instead of $('body').data(key, value) use
$.data(document.body, key, value).
Also .data() lets you access HTML5 data-* attributes. Note, that doing so values are converted to proper objects if possible. See http://jsfiddle.net/wLfJV/1/
Unrelated, but worth reminding: don't use $(this).attr('id')— this.id is simpler and much much faster: http://jsperf.com/el-attr-id-vs-el-id/2