01.
<html>
02.
<head>
04.
05.
</head>
06.
<body>
07.
<p>localStorage & sessionStorage</p>
08.
Input your name <input type=
"text"
id=
"txtName"
name=
"txtName"
> <br />
09.
Input your email <input type=
"text"
id=
"txtEmail"
name=
"txtEmail"
> <br /><br />
10.
<input type=
"button"
id=
"btnNext"
value=
"Next"
>
11.
</body>
12.
<script type=
"text/javascript"
>
13.
$(document).ready(
function
(){
14.
15.
16.
if
(
typeof
(Storage) ==
"undefined"
) {
17.
alert(
"Not storage support"
);
18.
}
19.
20.
21.
$(
"#btnNext"
).click(
function
(){
22.
23.
24.
localStorage.setItem(
"sName"
, $(
"#txtName"
).val());
25.
localStorage.setItem(
"sEmail"
, $(
"#txtEmail"
).val());
26.
27.
window.location=
"page2.html"
;
28.
});
29.
});
30.
</script>
31.
</html>