Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Level 11 lesson 7 - cookie pls help

<html>
<head>
<script>
// fetch cookie to check
let cookie =document.cookie ;
if(cookie.search("Hello=World")>=0)
{
console.log("Cookie found");
}
else {
document.cookie="Hello=World";
}
cookie = document.cookie;
console.log(document.write(cookie));
</script>
</head>
<body>

</body>
</html>
by

5 Answers

SaravananRajendran
Hey dude i have completed this for each lesson , now i am stuck in cookies lesson , that's what mentioned above...
Sanju3399
oh sorry
Sanju3399
try this code i got output


<html>
<head>document.cookie="Hello=World";
<script>
let cookie = document.cookie;
if(cookie.search("Hello=world")>=0)
{
console.log("Cookie found");
}
else {
document.cookie="Hello=World";
}
cookie = document.cookie;
document.write(cookie);
</script>
</head>
<body>

</body>
</html>
Sanju3399
bro i have done my course

ru doing css course ??
richard2022
@Hello folks, Can you help me on this one please. https://www.studytonight.com/forum/level-11-lesson-9-javascript

Login / Signup to Answer the Question.