-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload.html
More file actions
27 lines (26 loc) · 745 Bytes
/
load.html
File metadata and controls
27 lines (26 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<p><a href="cookia.html">Link</a></p>
<p id="info"></p>
<script src="cookie.js"></script>
<script>
addEventListener('load', welcome)
function welccome() {
const info = document.getElementById('info')
if (getCookie('Name')) {
info.innerHTML = 'Welcome Back, ' + getCookie('Name')
}
else {
let name = prompt('Please Enter Your Name', 'User')
setCookie('Name', name, 7)
info.innerHTML = 'Welcome, ' + name
}
}
</script>
</body>
</html>