Skip to content

Instantly share code, notes, and snippets.

@djpnewton
Last active December 13, 2019 00:06
Show Gist options
  • Save djpnewton/19f7c412afb96a53d21b3b8829a10b9b to your computer and use it in GitHub Desktop.
Save djpnewton/19f7c412afb96a53d21b3b8829a10b9b to your computer and use it in GitHub Desktop.
<html>
<body>
<div id="mediv">
</div>
<script>
var mediv = document.findElementById("mediv");
localStorage.setItem("bob", "the builder");
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);
mediv.innerHTML += "<div>key: "+ key + ", value: " + value + "</div>";
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment