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/

 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.


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 Programming Questions!