I have a an image that when you click, this function runs.
function img(num) {
var src = "images/main" + num + ".jpg";
document.getElementById("popover-image").src = src;
$("#sheet").css("display", "block");
}
When you click on the “X” (image), this function runs:
function close() {
$("#sheet").css("display", "none");
}
but it doesn’t work.
Here is how my image is set up:
<img src="images/x.png" alt="Exit" onclick="close()" />
John Koerner’s code:
Your event handler wasn’t being attached properly.