This is a solution to the FAQ accordion challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- Hide/Show the answer to a question when the question is clicked
- Navigate the questions and hide/show answers using keyboard navigation alone
- View the optimal layout for the interface depending on their device's screen size
- See hover and focus states for all interactive elements on the page
- Solution URL: Add solution URL here
- Live Site URL: Add live site URL here
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- JavaScript
Animation of container when their property changes
p{
overflow:hidden;
transition: max-height 0.7s;
height:auto;
}for(var j=0; j<arr2.length;j++){
img[j].style.display='none';
img2[j].style.display='block';
if(arr2[j]!=ans){
arr2[j].classList.add('hide');
}
}Better use of javascript
- Frontend Mentor - @NamanG22

