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

All comments

  • funupulu 120

    @funupulu

    Submitted

    First time building an accordion, as it were. In the app.js file, you'll notice I wrote many variables to individually target each question and answer element. I wrote the same logic twice because I don't know how to loop through each target without getting errors. Thanks always for any feedback. Current following this code-along to troubleshoot and debug.

    https://www.youtube.com/watch?v=FboXxLxg8eo&t=337s

    Other notes:

    I don't know how to center the <hr> tag. I don't understand what it is that enables margin and padding to apply or why it doesn't.

    chief 220

    @cujothechief

    Posted

    hi @funupulu. great start you have here. I've looked through your code and what you do is to set a class on the elements that are the same(you can create a class for all arrows, answers and questions). then you can getElementsByClassname for each class and use a forEach to loop through each element for each class. also you can use a ".classlist.toggle" to add and remove the styles. hope this helps!

    Marked as helpful

    0