forked from Pankaj-Str/JavaScript-Tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
34 lines (28 loc) · 974 Bytes
/
index.html
File metadata and controls
34 lines (28 loc) · 974 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
28
29
30
31
32
33
34
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
function sendcookies(){
let Name = document.getElementById("Name").value;
let Value = document.getElementById("Value").value;
// document.cookie = "username=John Doe; expires=Thu, 18 Dec 2013 12:00:00 UTC";
document.cookie = Name+" = "+Value;
//document.cookie = "username=John Doe; expires=Thu, 18 Dec 2013 12:00:00 UTC; path=/";
let x = document.cookie;
document.getElementById("print1").innerHTML = x;
}
</script>
</head>
<body>
User Name<input type="text" id="Name">
<br>
User Value<input type="text" id="Value">
<button onclick="sendcookies()">Send Cookies</button>
<ul>
<p id="print1"></p>
</ul>
</body>
</html>