本地储存(设置和获取信息)
作者:
想做一个画家 | 来源:发表于
2017-11-07 18:48 被阅读5次<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script>
// 设置本地储存信息
localStorage.setItem("username", "John");
// 获取本地储存信息
alert("username = " + localStorage.getItem("username"));
</script>
</body>
</html>
想要的结果.png
本文标题:本地储存(设置和获取信息)
本文链接:https://www.haomeiwen.com/subject/bhajmxtx.html
网友评论