MCPcopy Create free account
hub / github.com/codemistic/Web-Development / getdata

Function getdata

Magic Notes/app.js:9–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7addBtn.addEventListener('click',getdata);
8
9function 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');

Callers

nothing calls this directly

Calls 2

shownotesFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected