I am making a game and right now I'm trying to make a save feature and I have made it so you can click out of it, but my problem is when you click on the button again the screen doesn't work. Can you please help me out
Javascript
function savingGame() {
document.getElementById('saveScreen').style.display = "block"
document.getElementById('content').style.marginTop = '-83vh';
}
function saveGame1() {
if (localStorage.getItem('save1') != null) {
overwriteAlert();
} else {
localStorage.setItem('save1', index)
alert('gameSaved');
saveScreen.style.display = "none"
content.style.marginTop = "-3vh"
}
}
function noSave() {
if (window.getComputedStyle(saveScreen).display == "block") {
document.getElementById('content').onclick = function() {
saveScreen.style.display = "none"
content.style.marginTop = "-3vh"
}
}
}