I have a plunker to set a value in localStorage:
<!DOCTYPE html>
<html>
<script>
localStorage.setItem('test', "hadddddha");
</script>
</html>
And I have a code http://www.addbba.com/testLocalStorage.html to get it:
<!DOCTYPE html>
<html>
<script>
var test = localStorage.getItem('test');
console.log(test)
</script>
</html>
Oddly, the console shows the value is null
. Does anyone know what happened?