javascript - Creating a html page that store data dynamically -
i want create html page, when entered text in text area, text should populated page , when closed page , opened again, entered data should seen there. please me achieve this...
i dont want of php.
please refer below image trying my page trying make
you can save data on client using window.localstorage (or use fallback cookies), example implementation like:
// tiny utils save , load entered text const savetext = (text) => localstorage.setitem('text', json.stringify(text)) const loadtext = () => json.parse(localstorage.getitem('text')) // reference our `textarea` , listen changes document .queryselector('textarea') .addeventlistener('change', evt => savetext(evt.target.value)) // somewhere else in app, e.g. on load, prefill textarea document.queryselector('textarea').value = loadtext()
Comments
Post a Comment