I am working on a project that involves a global 'bank' of points.
I've been trying to use snippits of this code for it, but I can't get the variable to save after refresh.
    <!DOCTYPE HTML>
<html>
<head>
    <title>Javascript variable testing</title>
</head>
<body>
    <script type="text/javascript">
    var clicks = 500000;
    function onClick() {
        clicks += 1;
        document.getElementById("clicks").innerHTML = clicks;
    };
    </script>
    <button type="button" onClick="onClick()">Click this bit</button>
    <p>Clicks: <a id="clicks">500000</a></p>
</body>
</html>
 
    