Question: Extra 6-3 Modify the FAQs application This exercise has you make a minor modification to the FAQs application. When youre done, this application should work
Extra 6-3 Modify the FAQs application This exercise has you make a minor modification to the FAQs application. When youre done, this application should work the same as before, except that only one answer can be displayed at a time. In other words, when the user clicks on a heading to display the answer, the other answers must be hidden. 1. Open the HTML and JavaScript files in this folder: exercises_extra\ch06\faqs\ Then, run the applicat ion to refresh your memory about how it works. 2. Add code to the toggle() function so only one answer can be displayed at a time. To do that, create an array of the h2 elements. Then, use a for loop to go through the h2 elements in the array and remove the class attribute for all h2 elements that arent the one that has been clicked. You also need to remove the class attributes for all of the div siblings of the h2 elements that werent clicked.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
