Q4. (a) (1) Write JavaScript code to create the object "Photol" that has the following properties and values as shown in
Posted: Fri May 20, 2022 12:00 pm
Q4. (a) (1) Write JavaScript code to create the object "Photol" that has the following properties and values as shown in Figure 4.0: Property Value photoID 1 filename 1.jpg description Photo 1 Figure 4.0: Properties of Photo Object ( Write the JavaScript code to display the content of Photol object created in Q4(a)(i) as JSON string in an alert window. (ii) If Photos contains an array of Photo objects with the properties as defined in Figure 4.0, write the JavaScript code that uses the JQuery "each" method to display all the photos. Each image must be displayed in a separate <div> tag. All the <div> tags must be displayed in the clement that has the id "album". The output displayed by the web browser is as shown in Figure 4.1 below. Photo 1 Photo 2 Photo 3 Figure 4.1: Output of images displayed in web browser. [Note: For devices not capable of displaying images, the description of the photo will be shown instead.)