</head>
<script src="web2.js"></script>
<body>
<table>
<tr><td>??????</td><td><input type="text" id="name" /></td></tr>
<tr><td>Email??</td><td><input type="text" id="email" /></td></tr>
<tr><td>?綽????</td><td><input type="text" id="tel" /></td></tr>
<tr><td>?????</td><td><input type="text" id="memo" /></td></tr>
<tr>
<td></td>
<td><input type="button" value="????" onclick="saveStorage()" /></td>
</tr>
</table>
<hr>
<p>??????
<input type="text" id="find" />
<input type="button" value="????" onclick="loadStorage('msg')" />
</p>
<p id="msg"></p>
</body>
</html>
function saveStorage(id){
var data=new Object;
data.name=document.getElementById("name").value;
data.email=document.getElementById("email").value;
data.tel=document.getElementById("tel").value;
data.memo=document.getElementById("memo").value;
var str=JSON.stringify(data);
localStorage.setItem(data.name??str);
alert("?????????");
}
function loadStorage(id){
var find= document.getElementById('find').value;
var str= localStorage.getItem(find);
var data=JSON.parse(str);
var result="??????"+data.name+"<br>";
result+="??????"+data.email+"<br>";
result+="??????"+data.tel+"<br>";
result+="??????"+data.memo+"<br>";
var target=document.getElementById(id);
target.innerHTML=result;
}