标签:
// sessionStorage.setItem("message",str);
function saveStorage(id){
var target = document.getElementById(id);
var str = target.value;
//保存数据的方法 key value
localStorage.setItem("message",str);
}
function loadStorage(id){
var target = document.getElementById(id);
var msg = localStorage.getItem("message");
target.innerHTML = msg;
}
web storage: sessionStorage 和 localStorage
标签:
原文地址:http://www.cnblogs.com/htmlphp/p/4770959.html