javascript - Show new line instead of \n -


i experimenting html5's new localstorage , far have been in capturing content (text) inputted onto form , storing in localstorage.

my problem starts when person comes page, want localstorage values loaded correct input on form.

i doing success, users see following:

textarea text

but them see text without double quotes , new lines characters, them see:

hi

how you

just inputted originally. how can achieve this? appreciated.

to set value of text area, using following:

$(document).ready(function() {     alltextareasonpage.each(function(index, entry) {         var idoftextarea = $(this).attr('id');         if (pagelocalstorage.get(idoftextarea)) {             $(this).val(pagelocalstorage.get(idoftextarea));         }     }); }); 

looks me string being stored json...

$(this).val(json.parse(pagelocalstorage.get(idoftextarea))); 

should solve it, should cause...


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -