Saving list items


show more Saving list items provides you with in-depth training on Web. Taught by Joseph Lowery as part of the HTML5 Projects: Engaging Ecommerce show less
please wait ...

Saving list items

Local storage, or web storage, is another advanced technology under the HMTL5 umbrella that does a great job simply. Let me show you how easy it is to store items in the browser's local storage. So, we have our index.htm file opened, but we don't want to put the necessary code here. We're going to instead move it to dragdrop.js, since it is essentially dealing with the dropped items that we're going to save. So, the first thing I need to do is to declare a variable, and I'm going to put that right at the top of the page.

So, I'll enter var, and I like to name my variables starting off with the article V. So, theFaves. And we're going to set that equal to document.getElemantById('faves');. Make sure to put that semicolon at the end. Now, what is the element ID faves? Let's go back to the HTML for just a sec. I'll scroll down to where my faves are. And here you see it's the ID in the unordered list. All right, let's had back to dragdrop.js, ...

Saving list items
Video duration: 3m 9s 37m 29s Intermediate

Viewers:

Saving list items provides you with in-depth training on Web. Taught by Joseph Lowery as part of the HTML5 Projects: Engaging Ecommerce

Subject:
Web
Software:
HTML JavaScript CSS
Author:
please wait ...