2021-10-03 19:53:08 +02:00

16 lines
394 B
HTML

<!DOCTYPE html>
<html>
<body>
<div id="whatname"></div>
<button onclick="whatName()">What name?</button>
<script>
window.localStorage.setItem("name", "That name!");
function whatName() {
window.localStorage.clear();
document.getElementById("whatname").innerText = window.localStorage.getItem("name");
}
</script>
</body>
</html>