Design comparison
SolutionDesign
Solution retrospective
Had trouble with the addEventlistener on the mark all as read and kept getting the error ' Null is Not an Object eventlistener'.
Community feedback
- @basitkoraiPosted over 1 year ago
Hi, Brother How are you? You're nailing it, but I have some suggestions for you that I think will improve your project.
HTML: Here are things you must have in your HTML
- You must use a
<main>...</main>
tag for better accessibility. - Each Webpage must have an
<h1></h1>
. (Level one heading). - You must use
<article></article>
tag for each item that can standalone. e.g. notifications, sidebars, etc.
Just try to write more semantic HTML
Add transitions as well
And, as far as Javascript is concerned. I have fixed all the bugs.
Here is the code
const button = document.getElementById("mread"); const unseenNotifications = document.querySelectorAll(".unseen"); const numOfNotifications = document.querySelector(".num"); button.addEventListener("click", () => { unseenNotifications.forEach((item) => { let dot = item.querySelector(".dot"); numOfNotifications.remove(); item.classList.remove("unseen"); // removes unseen class from each notification dot.remove(); // removes the dot button.remove(); // removes the mark as read buttons as you have marked all as read why would you need it anymore }); });
It's all about Problem-Solving.
Tip: Try to break down the functionality before coding.
Happy Coding ✌️
0 - You must use a
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord