Skip to content Skip to sidebar Skip to footer

How To Save Data With White Spaces In Local Storage Using Javascript In Html5?

Data is fetched from web service in variable. How to store the data with white spaces ex:'Bread Butter' in the local storage? In the function selected_index I have passed the item_

Solution 1:

DOM Storage Guide

Example

varstring = 'Bread Butter';

localStorage.setItem("DishName", string);

alert(localStorage.getItem('DishName'));

On jsFiddle

Post a Comment for "How To Save Data With White Spaces In Local Storage Using Javascript In Html5?"