-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestinput.html
More file actions
57 lines (49 loc) · 1.26 KB
/
testinput.html
File metadata and controls
57 lines (49 loc) · 1.26 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<head>
<title>
mentee
</title>
<link rel="stylesheet" href="css/uikit.css"/>
<style>
</style>
<script type="text/javascript">
$(document).ready(function () {
function init() {
if (localStorage["name"]) {
$('#name').val(localStorage["name"]);
}
if (localStorage["email"]) {
$('#email').val(localStorage["email"]);
}
if (localStorage["message"]) {
$('#message').val(localStorage["message"]);
}
}
init();
});
$('.stored').keyup(function () {
localStorage[$(this).attr('name')] = $(this).val();
});
$('#localStorageTest').submit(function() {
localStorage.clear();
});
</script>
</head>
<body>
<form id="localStorageTest" method="post" action="">
<label>Name:</label>
<input type="text" name="name" id="name" class="stored" value="" />
<label>Email:</label>
<input type="email" name="email" id="email" class="stored" value="" />
<label>Message:</label>
<textarea name="message" id="message" class="stored"></textarea>
<input type="submit" class="demo-button" value="Submit" />
<script>
function retriece(){
var myData = localStorage.getElementById('name');
}
localStorage.setItem("name", JSON.stringify(name));
</script>
</form>
</body>
</html>