Skip to content

Instantly share code, notes, and snippets.

@rsbohn
Last active August 29, 2015 14:05
Show Gist options
  • Save rsbohn/d0c7baeaad5fcf6bbbc9 to your computer and use it in GitHub Desktop.
Save rsbohn/d0c7baeaad5fcf6bbbc9 to your computer and use it in GitHub Desktop.
Quick-n-dirty editor for browser localStorage
<div id='tag' contenteditable='true'>boot</div>
<textArea id='B'>
var Xput = function() {
localStorage[tag.textContent] = B.value;
}
var Xget = function() {
B.value = localStorage[tag.textContent];
}
var Xopen = function(name) {
tag.textContent = name;
Xget();
}
</textArea>
<script>
var B = document.getElementById('B');
var tag = document.getElementById('tag');
eval(B.value);
Xput();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment