save a note to localstorage as an Object

This commit is contained in:
2020-05-22 14:58:16 +02:00
parent 029d2276fa
commit 1e6a4b2fdf
3 changed files with 41 additions and 9 deletions
+35 -1
View File
@@ -2,4 +2,38 @@ $(document).ready(function(){
$("#addNoteDiv").on('click', function() {
$("#noteFormDiv").toggle()
})
})
$("#saveNoteButton").click(getNoteObject);
})
const noteFolder = "C:\\Users\\wuest\\Desktop\\Studium\\Master\\MDT5\\Hofmann\\Praktikum\\WebApp\\notes\\";
function saveNoteObject(){
let noteTitle = document.getElementById('inputTitle').value;
let noteText = document.getElementById('noteText').value;
let noteObj = {
title: noteTitle,
text: noteText
};
let noteObj_serialized = JSON.stringify(noteObj);
localStorage.setItem("noteObj", noteObj_serialized);
}
function getNoteObject(){
}