Local storage basket

Overview

Add to basekt using localStorage()

date

April 2016

tools used

HTML, SCSS, jQuery, localStorage

How

Using Local Storage, which allows you to use JavaScript to store data locally in a user's browser. By creating a product using a contructor function and accessing the object and placing them into the dom. On the click of add to basket, information can be stored into local storage and stay within the basket. If the user closes the browsers or refreshes, the basket items will remain. The items can be removed as well by the click of a button within the basket. Local storage can be a powerful tool and can be used in a number of ways to aid the user. A few examples are a to do list, shopping basket and editing a web page appearance, view example.

Learnt

Using local storage setItem() to store and getItem() to get back information.

See the Pen local storage basket by Harry Beckwith (@fun) on CodePen.

← Back to all projects