Workshop 2: Exercise 5: random image on each page reload

Back to Workshop 2 index

Exercise 5

Use document.write to output an image tag with a real image to the page. When you're done, try writing a JavaScript function to display a random image from the following list of images. HINT: You can access individual images using the table index. Images[0] for example contains the url: "http://farm4.staticflickr.com/3691/11268502654_f28f05966c_m.jpg".
			var images =[
				"http://farm4.staticflickr.com/3691/11268502654_f28f05966c_m.jpg",
				"http://farm1.staticflickr.com/33/45336904_1aef569b30_n.jpg",
				"http://farm6.staticflickr.com/5211/5384592886_80a512e2c9.jpg"
			];