Northwest-Class 4-Abed Al-JS Core 2-Week3-InClass & Mandatory#85
Northwest-Class 4-Abed Al-JS Core 2-Week3-InClass & Mandatory#85Abed-Aghbar wants to merge 1 commit intoCodeYourFuture:mainfrom
Conversation
| Prefer to work on a codepen? https://codepen.io/makanti/pen/abOreLg | ||
| ================ | ||
| */ | ||
| setTimeout(() => { |
| ]; | ||
|
|
||
| // create showMovies function | ||
| showMovies(movie); |
There was a problem hiding this comment.
You have a typo here. movie should be movies
| // create showMovies function | ||
| showMovies(movie); | ||
|
|
||
| function showMovies(movies) { |
There was a problem hiding this comment.
Good work Abed. movie instead of item would be better in the forEach method.
| } | ||
|
|
||
|
|
||
| function showMovies(movies) { |
There was a problem hiding this comment.
Good work Abed. I see that you are removing any pre-existing movie paragraphs from #all-movies before running this function, to avoid duplication. Another way to handle this problem would be to create a container element to append the movies to, then append this to #all-movies. This would separate .alert from the listed movies.
| ================ | ||
| */ | ||
|
|
||
| const submit = document.getElementById('submit'); |
There was a problem hiding this comment.
Good work Abed. You have the right idea here but the Task asked for a form. It's been a long time since we did forms. Have a read of this: https://www.javascripttutorial.net/javascript-dom/javascript-form/
|
|
||
|
|
||
| const all_image = document.querySelectorAll("img"); | ||
| all_images.forEach((img) => { |
There was a problem hiding this comment.
Hi Abed, you have a typo here. Besides that this works. I know you are coming from Python but camelCase is preferred over snake_case in JavaScript.
| }, | ||
| ]; | ||
|
|
||
| Array.from(allSections).map((element, index) => { |
There was a problem hiding this comment.
Hi Abed, fix the typo and this works. Make sure you check the console in the browser's dev tools for errors. They will help you find typos like this one.
| @@ -1,5 +1,23 @@ | |||
| function setAlarm() {} | |||
| function setAlarm() { | |||
There was a problem hiding this comment.
Nice work Abed, there is a bug though. What happens when you try to set the Alarm while the timer is already running? What is causing this bug and how could you fix it?
| @@ -1 +1,37 @@ | |||
| /** Write your CSS in here **/ | |||
There was a problem hiding this comment.
Hi Abed, look through the styles to see if you can find a reason why the text does not show in the browser.
| const quote_div = document.getElementById('quote_div'); | ||
| const button = document.getElementById('button'); | ||
| let quote = document.getElementById("quote_h1"); | ||
| let author = document.getElementById("author"); |
There was a problem hiding this comment.
Hi Abed, you have a typo here, please check the id of the element you want.
| }; | ||
|
|
||
| // When the new quote button is clicked, call the function newQuote | ||
| newQuoteBtn.addEventListener("click", newQuote); |
There was a problem hiding this comment.
Hi Abed, you have a typo here, you can't attach an event listener to an element that doesn't exist.
Your Details
Homework Details