I want to make a bookmark button, like a heart or something ... the issue is that I did not want to use a database and I found a code that works and I like it but when it exits and re-enters it restarts and deletes the data:
var likes =0;
function like(){
document.getElementById("show").innerHTML=likes;
likes=likes+1;
}
#button {
background-color: #4CAF50;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
<!DOCTYPE html>
<html>
<head>
<title>me gusta</title>
</head>
<body>
<button id="button" onClick="like()">LIKE</button>
<p type="text" style="color:blue;"id="show"></p>
<h2>LIKES</h2>
</body>
</html>
How can I do it to be saved without using database?