diff --git a/index.html b/index.html
index 9ee05b7..dd377d5 100644
--- a/index.html
+++ b/index.html
@@ -96,6 +96,13 @@ body, html {
+
+
+
+
×
+
Some text in the Modal..
+
Return to Top
@@ -301,6 +308,8 @@ function w3_close() {
}
var mybutton = document.getElementById("myBtn");
+var modal = document.getElementById("myModal");
+var span = document.getElementsByClassName("close")[0];
function setCookie(cname,cvalue,exdays) {
const d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
@@ -330,11 +339,21 @@ function checkCookie() {
alert("Welcome again " + user);
} else {
user = prompt("Please enter your name:","");
+ modal.style.display = "block";
if (user != "" && user != null) {
setCookie("username", user, 30);
}
}
}
+span.onclick = function() {
+ modal.style.display = "none";
+}
+
+window.onclick = function(event) {
+ if (event.target == modal) {
+ modal.style.display = "none";
+ }
+}