In order to develop an Expand/Collapse application for the Murach's JavaScript and jQuery review the HTML code to identify each topic consisting of two div elements and an anchor element.
The second div element of each topic is assigned a class called "hide", which has a corresponding style rule.To add functionality to the link, create an event handler for the ready() method within the JavaScript file. Inside this function, create an event handler for the click() method of the anchor elements. Begin the event handler by using the toggleClass() method to add or remove the class from the div element located above the clicked link element, depending on whether the class is present.
Complete the click event handler by testing if the div element above the current link element has the "hide" class. If it doesn’t, change the text for the link to "Show less".