I have this piece of code in JavaScript that tries to change the property in CSS "visibility: hidden;" for "visibility: none;" with a click of a button
const modal = document.getElementById('modal');
const button = document.getElementById('button');
button.addEventListener('click', function(){modal.style.visibility = "none";})
This code can make the modal disappear, but can't make it appear
Here it is the modal CSS properties:
#modal{
margin: 5px 20px;
padding: 20px 20px;
position: absolute;
top: 105px;
right: 5px;
width: 250px;
height: 150px;
background-color: lightgreen;
border-radius: 10px;
color: darkgreen;
align-items: center;
border: 4px solid darkgreen;
visibility: hidden;
}