Home > Mobile >  Data from Local Storage appending to HTML
Data from Local Storage appending to HTML

Time:09-24

My local storage is now working fine: it's storing the data on a single key.

However, when I'm trying to append the data on HTML I'm getting this output on appending. Please see the image below.

Also, you can see my code here. I really appreciate your help guys. Step by step I'm now understanding the localStorage, but I'm having a road block in this one can anyone help me thanks in advance.

enter image description here

CodePudding user response:

You must put this where you append data to list-item

// appending data
           for (var i = 0; i < Object.keys(iDataHandler).length; i  ) {
                  $('.sNote').append(
                      '<div class="list-item" data-postid"' JSON.stringify(iDataHandler[(Object.keys(iDataHandler)[i])]) 
                      '</div><div class="close"><i class="fas fa-times"></i></div>'
                    );
            } 
  • Related