Check out a free preview of the full Learning jQuery course:
The "Data" Lesson is part of the full, Learning jQuery course featured in this preview video. Here's what you'd learn in this lesson:

Associate data with elements using data and removeData methods As of 1.4.4, the data method reads HTML5 data-* attributes and also parses JSON e.g. <div data-foo=”bar”> or <div data-img=’{“alt”:”pic”, “src”:”path/file.jpg”}’> Karl demos how he has used data for lazy-loading images Audience asks if changing the HTML5 data attribute updates the jQuery data method. Answer is no. data. Use HTML5 data attribute as a starting point to set the data Audience asks how Karl feels about dashes converting to camelCase data. Karl says spec wasn’t clear and part of it is implementing features before there is a spec. More demos and examples:

Get Unlimited Access Now