()
| 7 | addBtn.addEventListener('click',getdata); |
| 8 | |
| 9 | function getdata(){ |
| 10 | let notevalue = textarea.value; //Getting the data what user entered |
| 11 | let localnotes = localStorage.getItem('notes'); |
| 12 | |
| 13 | if(localnotes == null){ |
| 14 | notesarr = []; |
| 15 | } |
| 16 | else{ |
| 17 | notesarr = JSON.parse(localnotes); |
| 18 | } |
| 19 | notesarr.push(notevalue); |
| 20 | localStorage.setItem("notes",JSON.stringify(notesarr)); |
| 21 | |
| 22 | textarea.value=''; |
| 23 | shownotes(); |
| 24 | } |
| 25 | |
| 26 | function shownotes(){ |
| 27 | let localnotes = localStorage.getItem('notes'); |