Let's say I have an array of Customer structures and I need to generate HTML from it.
Currently I do something like this:
jQuery.each(customers, function(index, item) {
html =+ "<tr custID='" + item.ID + "'><td>" + item.Name + "</td><td>" + item.City + "</td></tr>";
});
The issue here is that I manually add the custID attribute. I believe the cool way to do this would be using jQuery's Data function.
But how would I use it in this scenario?