Storing data in the DOM
问题 I have a list of books and I want to store data against each book e.g. Price, Quantity, id, catergory id, size, weight etc. I was looking at storing all this in the dom by extending the li elements representing each book in the list using data- attributes. This data could then be utilised directly with javascript. However I have read that accessing data- attributes is slow in a performance sense. In addition I can have multiple instances of the same book so am a little concerened about bloat