i am working on a little project. The project: making a button (when pressed the number goes plus 1). The problem that i have is when i refresh the page the current number will turn back to 0. Is there a way that the site remebers the current number? Here is the code i made(the button work.(the css file is not included.)):
<head>
<title>Clicker</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<script type="text/javascript">
var clicks = 0;
function clickME() {
clicks += 1;
document.getElementById("clicks").innerHTML = clicks;
}
</script>
<button class="button" type="button" onclick="clickME()">Click me</button>
<p class="number"><a id="clicks">0</a></p>
</body></html>