Responsive Faq Accordian Using HTML CSS JS

Solution retrospective
Just finished my first website using HTML, CSS, and JS. It works well on both computers and phones, thanks to the mobile-first approach. Curious to hear what you think!
Please log in to post a comment
Log in with GitHubCommunity feedback
- P@Deanogit
Hey @Enayut,
Great work getting this solution submitted
I was just taking a look at your code and noticed something you might be interested in.
The background images are not loading due to a small error in the syntax.
Your code:
function changeImg(){ let width = window.innerWidth console.log(width) if (width > 700) { img.setAttribute("src","/assets/images/background-pattern-desktop.svg"); } else { img.setAttribute("src","/assets/images/background-pattern-mobile.svg"); }
try adding a
.
in-front of the first/
when declaring the image paths.Try checking the syntax for the icons too
I hope this helps
Great effort building this solution
Marked as helpful
Join 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