This is apart of the 50 projects in 50 days challenge and is the twelfth project.
- To create a FAQ that opens and closes when the icon is clicked. The challenge involves HTML, CSS and Javascript.
- Source code: https://github.com/romila2003/FAQ-Collapse
- Live website: https://faq-collase.netlify.app/
- Semantic HTML5 markup
- Plain CSS
- Vanilla Javascript
- Flexbox
This project was fun and simple and heavily relied on CSS rather than JS since there was only a toggle
feature. I enjoyed the design process and will use this concept in future projects such as the frontendmentor FAQ challenge.
Javascript - toggle
:
const toggles = document.querySelectorAll(".faq-toggle");
toggles.forEach(toggle => {
toggle.addEventListener("click", () => {
toggle.parentNode.classList.toggle("active");
})
})
For future developments, I should implement the features/concepts learned over the last few projects and future projects, into practical projects/challenges such as the frontendmentor.io projects.
- Twitter - @romila003
- Frontend Mentor - @romila2003