📜  在浏览器中存储数据 javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:13.806000             🧑  作者: Mango

代码示例3
localStorage.setItem("user_name", "Bob");

document.body.addEventListener("click", function(){
  alert(localStorage.getItem("user_name"))
});