I'm trying to work on a project at school and I'm stuck displaying to-do lists one in another, meaning, I'm trying to make a web app based on localStorage and JSON, using HTML, CSS, and JS. I have the following JSON Object and I wish to display the list in the list, the to-do lists inside cards defining what's what.
var listStorage = {
"lists":[{
"pierre": ["Do the laundry", "Pick up James from school", "Call Charlie"]
},{
"michal": ["Go to the Mall", "Eat ice-cream", "Launch my new APP"]
}]};
Now what I need to do is getting to the name of the lists (pierre,michal) and display them in two different divs, and then get to the value inside (Do the laundry..) and display them under each name. that's what I did to get each list name:
for (var j = 0; j < listStorage.lists.length;j++){
$('body').append($('div'));
$('div').append(listStorage.lists[j]);
}
But the second function for getting each item in each list array is not working for me in any way. Can anyone help me get it? Please note the list names are unknown strings that each user enters and it's added to the localStorage. Please feel free to ask me anything if there's anything unclear, this is my first time asking here.