Modify code 1. In the JavaScript file, add an event handler for the ready() event method. (Check
Question:
Modify code
1. In the JavaScript file, add an event handler for the ready() event method. (Check out how Onload() and document.ready() differs: https://api.jquery.com/load-event/; https://learn.jquery.com/using-jquery-core/document-ready/ )
2. Use the each() method to run a function for each element in the unordered list of items. Then, add jQuery code that gets the URL and id for each image and preloads the image. You can get the URL from the href attribute of the element, and you can get the caption from the id attribute.
3. Add an event handler for the click event of each link. The function for this event handler should accept a parameter named evt. The jQuery code for this event handler should display the image and caption for the link that was clicked. In addition, it should use the evt parameter to cancel the default action of the link.
4. Add a jQuery statement that moves the focus to the second link on the page when the page is loaded.
5. Verify there are no errors.