Im trying to add in a close button for my div. It opens all ok but doesnt close and I cant fathom why ...
The code is here
window.onload = function display() {
document.getElementById("advert").style.display = "block";
}
function close() {
document.getElementById("advert").style.display = "none";
}
<div id="advert">
<div class="advert-content">
<button class="Close" onclick="close()">×</button>
<p>Content is here</p>
</div>
</div>