If I assign a text input tag to the id stored_data1 in the code below, would I be able to save my data client-side (such as saving it on a flash drive)?
HTML
Data that is retrieved will appear here
<div id="dataStore"></div>
JS
<script>
if (typeof Storage !== 'undefined') {
localStorage.setItem('stored_data1', 'Blue Box');
document.getElementById('dataStore').innerHTML =
localStorage.getItem('stored_data1');
} else {
// in case web storage is not supported
document.getElementById('dataStore').innerHTML =
'Web storage not supported.';
}
</script>
The code above is a web storage API for HTML. I'm hoping to find a way to eventually fit it into some programs I made.