+ 3
HTML5
The complete way to do local storage => in 2 types? with examples!
2 odpowiedzi
+ 2
<div id="res"></div>
<script>
// Check browser support
if (typeof(Storage) !== "undefined") {
// Store
localStorage.setItem("name", "test");
// Retrieve
document.getElementById("res").innerHTML = localStorage.getItem("name");
} else {
document.getElementById("res").innerHTML = "Sorry, your browser does not support Web Storage...";
}
</script>
<!--Try on web version, sololearn codeplayground dose not support this-->
+ 1
thanks