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

LEVEL 11 LESSON 7. Not Able to submit the code

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

</body>
</html>
by

4 Answers

sam5epi0l
Try this code:

<!doctype html>
<html>
<head>
<style>
#box {
height: 100px;
width: 100px;
border-radius: 10px;
background-color: #4535AA;
}
… // access div element with id box
let box = document.getElementById("box");
// change background color
box.style.backgroundColor = "#FFB643";
// show alert
alert("Color changed");
}
</script>
</body>
</html>

Let me know if you face any issues.
Vikas4801
This is not the question I asked. I'm talking about the last module in the js-course called Javascript Advance or Lesson 7 in Level 11. I already mentioned the code for it. it's about cookies, I hope now you will able to help me out.
iamabhishek
Can you try this code for your if condition:

if(cookie.search("Hello=World") >= 0)
{
console.log("Cookie found");
}
AmosGloria
Hello Vickas, please what code did you use to pass level 9, lesson 9 of JS course. All codes I've tried is not working

Login / Signup to Answer the Question.