This course is out of date and does not reflect our standards or industry best practices. We now recommend you take the Complete Intro to Web Development, v3 course.

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.

Get Unlimited Access Now