Home of web learners

www.webn3rd.com

javascript has function to work with cookies data

Lets create a cookie by javascript

<html>
<head>
    
</head>
<body>
    <script>
document.cookie = "color=green";
    
</script>       
</body>
</html>

Here,we created a cookie which cookie name is color and value is green

Lets see stored cookie

<html>
<head>
    
</head>
<body>
    <script>
document.write(document.cookie);
    
</script>       
</body>
</html>

By document.write we can see the cookie stored in browser,so here it shows your stored cookie named color with value green

webn3rd.com

About webn3rd