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

Javascript LESSON 11 LESSON 7, COOKIES

PLEASE PROVIDE ME THE SOLUTION I AM STUCK
by

2 Answers

sam5epi0l
Alright. We are always here to help you out. Try with the below code:


let cookie = document.cookie;
if(cookie.search("Hello=World")>=0)
{
console.log("Cookie found");
}
else {
document.cookie = "Hello=World";
}
// fetch cookie to print value
cookie = document.cookie;
document.write(cookie);
AmosGloria
Hello, please how did you answer level 9, lesson 9 of JS course? I'm stuck

Login / Signup to Answer the Question.