How to create an object array of localStorage in javascript?
-
I have to make a random key which I did and get id tags from my html file, which I did but when I check it on web inspector it doesn't work. function saveInformation(){ var id = Math.floor(Math.random()*100000001); getSelectionRadio(); var info = {}; info.major = ["Major Choice", idTag("majorChoice").value]; info.cName = ["Course Name", idTag("courseName").value]; info.cSection = ["Course Section", idTag('courseSection').value]; info.topicAndSec = ["Topic and Section", idTag('topicAndSection').value]; info.todaysDate = ["Today's Date", idTag('todaysDate').value]; info.dueDate = ["Due Date", idTag('dueDate').value]; info.option = ["Turn In Option", optionValue]; info.note = ["Note Section", idTag('add').value]; localStorage.setItem(id, JSON.stringify(info)); alert("Assignment Saved!!"); } saveInformation();
-
Answer:
here is the guide of how to do so... http://www.w3schools.com/js/js_objects.asp Good luck!
Alexander Herrera at Yahoo! Answers Visit the source
Related Q & A:
- How to create deep object with dynamic name in Javascript?Best solution by Stack Overflow
- How to create an SlideShow in javascript?Best solution by Stack Overflow
- How can I remove duplicate Objects from array of Objects in javascript?Best solution by Stack Overflow
- How to create an Object with multiple properties of the same name?Best solution by javascript.info
- How to create a flexible object?
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.