Question: This exercise has you make a minor modification to the FAQs application. When you're done, this application should work the same as before, except that

This exercise has you make a minor modification to the FAQs application. When you're 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.
JavaScript FAQs
What is JavaScript?
What is jQuery?
jQuery is a library of the JavaScript functions that you're most likely to need as you
develop web sites.
Why is jQuery becoming so popular?
Open the application in this folder:
ch06fagsi
Then, run the application to see how it currently works.
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-of loop to go through the h2 elements in the array and
remove the class attribute for all h2 elements that aren't 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 weren't clicked.
Save your files in the folder above.
indextral ?
&IDOCTVPE htol?
sIDOCTVPE htwl > shtal Lang-"en">
sheads
sneta charset-"UrF -8?
"neta name-"viemport" content-"width-device-width, initial-scale-1">
ctitle)FAQs
body>
smain id-"fags"?
h1>JavaScript FAQs
div :)
(:1i:):
 This exercise has you make a minor modification to the FAQs

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!