Whenever i initialize a variable called 'name' it keeps its value through pages.
Like this:
page1.html
<html>
<script>
var name = prompt("What's your name?");
alert(name);
</script>
<a href='page2.html'> Page2</a>
</html>
page2.html
<html>
<script>
alert(name);
</script>
</html>
So in both pages the variable name keeps the value of what it has been given in the prompt of the first page, the two pages alert the same thing, could someone explain me why this happens?