The only thing I can think of is that the page is not ready, try to put this code at the end
<html>
<head></head>
<body>
<script type="text/JavaScript">
sessionStorage.setItem("classname", "value1");
sessionStorage.setItem("classdesc", "value2");
</script>
</body>
</html>
Final answer:
sessionStorage does not work in "local mode", but it will work if you upload the file to the server.
source
share