The week:8 was so fast paced that I couldn't learn any HTML, CSS and JavaScript whatsoever. The knowledge of syntax was a big hindrance in the pset:8. Thankyou so much Anvea
totally agree; I thought the problem was me, and I could not understand what they were doing this week. But actually I see some people who are having the same thoughts
Very good, just that on the last function the reason your code is getting reloaded is because of and what you can do is that in JS u can document.querySelector("#checker").addEventListener("click", function(event) { event.preventDefault(); // … do other stuff when the form is submitted }); This way u dont submit and the page doesnt autoupdate (reload)... understand?
thank you so much for your help Anvea. Your videos truly make a difference and have a major impact on me. Without your videos I would be so lost in this cs50 course, I watch every video you post and I find them all helpful. Thank you so much for your time and effort. From South Africa ❤
Thank you so much for the tutorial! This is another Solution, what do you think?
Document Trivia! Part 1: Multiple Choice What is the approximate ratio of people to sheep in New zealand? 6 people per 1 sheep 3 people per 1 sheep 1 person per 1 sheep 1 person per 3 sheep 1 person per 6 sheep
Part 2: Free Response In which country is it illegal to own one guinea pig, as a lone guinea pig might be lonely? Check Answer
// TODO: Add code to check answers to questions //run the script once the DOM is loaded window.addEventListener("load", function () { //when correct answer is clicked change button colour to green let correct = document.querySelector('.correct'); correct.addEventListener('click', function () { correct.style.backgroundColor = 'green'; document.querySelector('#feedback1').innerHTML = 'Correct!'; }); //When any incorrect answer is clicked, change color to red. let incorrects = document.querySelectorAll('.incorrect'); for (let i = 0; i < incorrects.length; i++) { incorrects[i].addEventListener('click', function () { incorrects[i].style.backgroundColor = 'red'; document.querySelector('#feedback1').innerHTML = 'Incorrect'; }); } //check free response submission document.querySelector('#check').addEventListener('click', function () { let input = document.querySelector('input'); if (input.value === 'Switzerland') { input.style.backgroundColor = 'green'; document.querySelector('#feedback2').innerHTML = 'Correct!'; } else { input.style.backgroundColor = 'red'; document.querySelector('#feedback2').innerHTML = 'Incorrect'; } }); });
Hello, this was very helpful! I have a question tho. When I try to press the buttons to test my code, I cannot get it to work. Like when I click the buttons, nothing happens. It doesn’t turn red/green and it’s the same for the free response question. When I press the button, it reloads the page. Idk what to do.
@@Anvea please upload as soon as possible because you are the best teacher 👩🏫🌻🌻🪻for learning the cs50 weeks solutions and i pray your life will be the best of happiness and sunshine and no toxicity and help us with understand this coding because i couldn't get what kind of error i'm having whatever i do it doesn't quite get right it's really annoying 🤯🤯. but then again TAKE CARE 🫡🤍🤍 PLEASE HELP ME WITH THISSS🥺🥺🥲🥲 you're the ONLY ONEE 🌻🌻
The week:8 was so fast paced that I couldn't learn any HTML, CSS and JavaScript whatsoever. The knowledge of syntax was a big hindrance in the pset:8. Thankyou so much Anvea
absolutely disappointed with the way they did week 8. I didn't understand anything at all either.
totally agree; I thought the problem was me, and I could not understand what they were doing this week. But actually I see some people who are having the same thoughts
Thanks!
Very good, just that on the last function the reason your code is getting reloaded is because of and what you can do is that in JS u can
document.querySelector("#checker").addEventListener("click", function(event) {
event.preventDefault();
// … do other stuff when the form is submitted
});
This way u dont submit and the page doesnt autoupdate (reload)... understand?
thank you!
I have written the code as it is but my buttons are not turning red why
????
thank you so much for your help Anvea. Your videos truly make a difference and have a major impact on me. Without your videos I would be so lost in this cs50 course, I watch every video you post and I find them all helpful. Thank you so much for your time and effort. From South Africa ❤
Thank you, very helpful.
Nice guide to this problem set. I had a hard time with html css and JavaScript, and this helped me a lot.
Thank you so much for this video Anvea! I was stuck on this for a few days and this really helped. Can you please make a guide for the pset in Week 8?
Awesome video, Anvea!! I really appreciate you and your guides! 🙏
Can you jump to week 9 finance
Than you Anvea 😃
Thank you so much for the tutorial! This is another Solution, what do you think?
Document
Trivia!
Part 1: Multiple Choice
What is the approximate ratio of people to sheep in New zealand?
6 people per 1 sheep
3 people per 1 sheep
1 person per 1 sheep
1 person per 3 sheep
1 person per 6 sheep
Part 2: Free Response
In which country is it illegal to own one guinea pig, as a lone guinea pig might be lonely?
Check Answer
// TODO: Add code to check answers to questions
//run the script once the DOM is loaded
window.addEventListener("load", function () {
//when correct answer is clicked change button colour to green
let correct = document.querySelector('.correct');
correct.addEventListener('click', function () {
correct.style.backgroundColor = 'green';
document.querySelector('#feedback1').innerHTML = 'Correct!';
});
//When any incorrect answer is clicked, change color to red.
let incorrects = document.querySelectorAll('.incorrect');
for (let i = 0; i < incorrects.length; i++) {
incorrects[i].addEventListener('click', function () {
incorrects[i].style.backgroundColor = 'red';
document.querySelector('#feedback1').innerHTML = 'Incorrect';
});
}
//check free response submission
document.querySelector('#check').addEventListener('click', function () {
let input = document.querySelector('input');
if (input.value === 'Switzerland') {
input.style.backgroundColor = 'green';
document.querySelector('#feedback2').innerHTML = 'Correct!';
} else {
input.style.backgroundColor = 'red';
document.querySelector('#feedback2').innerHTML = 'Incorrect';
}
});
});
you're the best
Hello, this was very helpful! I have a question tho. When I try to press the buttons to test my code, I cannot get it to work. Like when I click the buttons, nothing happens. It doesn’t turn red/green and it’s the same for the free response question. When I press the button, it reloads the page. Idk what to do.
Did you find any solution to this problem ? i'm having the same issue.
@@mananmudliar1353 yeah, I don’t have my code with me rn, but I will get back to you once I have access to it.
im having the same prob =( send help
the issue is on the curly braces if you put one at the wrong place.Go through your code step by step. I had the same issue and fixed it
@@thepnesh I got it figured out, thanks for your suggestion
Could you help with week 9 finance please? I am real stucked and frustrated by it as I can't resolve an error that keep recurring.
Hi Anvea, you don't have a week 9 walkthrough?
week 9 finance please
where are you from? u got a lovely accent
ps: i could not hear the frog being loud xD
please also upload week's 8 pset and also of week's 9, thanks!!
Hey!! Yes I fully intend to but life has taken over. Thank you so much for the reminder :’) I’ll try my best to publish the rest by November!! 🤞🏻
@@Anvea Best wishes!!
@@Anvea please upload as soon as possible because you are the best teacher 👩🏫🌻🌻🪻for learning the cs50 weeks solutions and i pray your life will be the best of happiness and sunshine and no toxicity and help us with understand this coding because i couldn't get what kind of error i'm having whatever i do it doesn't quite get right it's really annoying 🤯🤯. but then again TAKE CARE 🫡🤍🤍 PLEASE HELP ME WITH THISSS🥺🥺🥲🥲 you're the ONLY ONEE 🌻🌻
Does this script still work if more trivia questions are added, if not what should I do?
Thanks for the video
Week8 Homepage🙇🏻♂️
Promo sm 🎉
i send you a kiss 😘