fengchuanyu 8 months ago
parent
commit
e977ea0379
1 changed files with 9 additions and 0 deletions
  1. 9 0
      7_HTML5/6_cookie.html

+ 9 - 0
7_HTML5/6_cookie.html

@@ -17,6 +17,15 @@
         var resArr = document.cookie.split(";");
         console.log(resArr[1].split("=")[0]);
 
+        // 手动实现以下方法
+        setCookie(key,val,2);
+
+        getCookie(key);//返回一个cookie值
+
+        delCookie(key);//只需要将时间设置为过期时间
+
+
+
     </script>
 </body>
 </html>