Adds or retrieves given value associated with given key. (Don’t confuse with data-
attributes)
See also Element.removeData
Returns: objectElement
or, if value is not specified:
Returns: any value
for (var i = 0, i < 5, i++) {
paper.circle(10 + 15 * i, 10, 10)
.attr({fill: "#000"})
.data("i", i)
.click(function () {
alert(this.data("i"));
});
}