Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript DOM Scripting By Example Improving the Application Code Next Steps

karan Badhwar
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
karan Badhwar
Web Development Techdegree Graduate 18,135 Points

not able to understand how to add local storage to the code

I am stuck on the Local storage and Drop down menu from few days I have watched the video and tutorial got it a bit but not sure how to implement it, Would somebody be able to help me with it.

The screenshot attached below https://w.trhou.se/t8jkhbpy37

what exactly do you want to add to the local storage? Also, what do you mean about the drop down?

karan Badhwar
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
karan Badhwar
Web Development Techdegree Graduate 18,135 Points

Actually sir, Guil asked if we can try to do some manipulation like adding the data to local storage for data storage all the names of the guest i.e Guest List

and if we can add a drop down menu instead of the checkbox, that's what I am struggling with

1 Answer

I don't have time to research the dropdown thing at the moment, and the localStorage thing is more of a challenge than it looks like at first because you would want to store an HTML Node Element rather than just some text, but below is code that will get you started and this link to how to json stringify a dom element on stackoverflow should give you the rest of what you need.

I basically just adapted the code from the Using Local Storage workshop and am creating the list based on the names that were invited, so any edits to the guests will not be included when you reload the page. Also note that I did not provide a way to clear the local storage, so to do that, either remove all the guests individually or go to the console and enter localStorage.clear().

Here is the snapshot