@@ -182,17 +181,20 @@
var span = document.getElementsByClassName("close")[0];
// When the user clicks on the button, open the modal
- btn.onclick = function() {
+ btn.onclick = function(e) {
+ e.preventDefault();
modal.style.display = "block";
}
// When the user clicks on (x), close the modal
- span.onclick = function() {
+ span.onclick = function(e) {
+ e.preventDefault();
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
+ event.preventDefault();
if (event.target == modal) {
modal.style.display = "none";
}