LocalStorage Basic

Example checking if localStorage is supported.

Preview

Code

<button onclick="check()">Check Storage</button>

<p id="result"></p>

<script>
function check(){
 if(typeof(Storage)!=="undefined"){
  document.getElementById("result").innerText="localStorage supported";
 }
}
</script>

More HTML Web Storage Examples (5)