This is a solution to the FAQ accordion card challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Note: Delete this note and update the table of contents based on what sections you keep.
Users should be able to:
- View the optimal layout for the component depending on their device's screen size
- See hover states for all interactive elements on the page
- Hide/Show the answer to a question when the question is clicked
- Solution URL: Add solution URL here
- Live Site URL: Add live site URL here
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- JavaScript (ES6)
I have reinforced my knowledge in CSS and javascript.
To see how you can add code snippets, see below:
<h1>
Some HTML code I'm proud of because it has been a little difficult for me:
</h1>
function handleClick(ev) {
let clicked = ev.currentTarget;
const click = clicked.parentNode;
for (let index = 0; index < iconRotate.length; index++) {
if (clicked === iconRotate[index]) {
questionBlock[index].classList.toggle('hidden');
iconRotate[index].classList.toggle('icon-end');
questions[index].classList.toggle('bold');
}
}
}
for (const item of iconRotate) {
item.addEventListener('click', handleClick);
}
Use this section to outline areas that you want to continue focusing on in future projects. These could be concepts you're still not completely comfortable with or techniques you found useful that you want to refine and perfect.
- Javascript (ES6)
- CSS
- Website - Daniela Darnea
- Frontend Mentor - @mdanieladla