Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive Faq Accordian Using HTML CSS JS

Enayut 10

@Enayut

Desktop design screenshot for the FAQ accordion coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

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!

Community feedback

P
Dean 480

@Deanogit

Posted

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

2

Enayut 10

@Enayut

Posted

@Deanogit Thank you Very Much

1

Please log in to post a comment

Log in with GitHub
Discord logo

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