I am using the following link to create a tree like structure: LINK
This is my code :
LocalStorage does exactly that.
Use it like this :
localStorage.setItem('myCat', 'Tom');
console.log(localStorage.getItem('myCat')); // Tom
Use can use it to store stringify-ed objects as well :
var obj = { a : 1, b : 2};
localStorage.setItem('myObj', JSON.stringify(obj));
var obj2 = JSON.parse(localStorage.getItem('myObj'));