123456789101112131415161718192021222324252627282930313233 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- </head>
- <body>
- <script>
- // 设置cookie
- function setCookie(key,value,timer){
- }
- // 获取cookie
- function getCookie(key){
- }
- // 删除cookie
- function delCookie(key){
- }
- // 设置一个cookie name=张三 过期时间为10天后
- setCookie('name','张三',10);
- // 获取cookie
- console.log(getCookie('name'));
- // 删除cookie
- delCookie('name');
- </script>
- </body>
- </html>
|