// Attributes images of notable Australian cities
var cities = [
{
city: "Melbourne",
url: "http://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Melbourne_Skyline_and_Princes_Bridge_-_Dec_2008.jpg/640px-Melbourne_Skyline_and_Princes_Bridge_-_Dec_2008.jpg",
description: "A HDR tone mapped image of the Melbourne skyline and Princes Bridge as viewed from Southbank. Taken by myself with a Canon 5D and 24-105mm f/4L IS lens.",
date: "28th of December, 2007",
author: "David Iliff",
license: "CC-BY-SA 3.0",
wikimedia: "http://commons.wikimedia.org/wiki/File:Melbourne_Skyline_and_Princes_Bridge_-_Dec_2008.jpg"
},
{
city: "Perth",
url:"http://upload.wikimedia.org/wikipedia/commons/thumb/5/5d/Perth_CBD_from_Mill_Point_%282%29.jpg/800px-Perth_CBD_from_Mill_Point_%282%29.jpg",
description:"Perth CBD from Mill Point, Perth, Western Australia",
date: "21 March 2012, 07:58:56",
author: "J Harrison ([email protected])",
license: "Creative Commons Attribution-Share Alike 3.0 Unported license"
},
{
city: "Sydney",
url: "http://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Sydney_Opera_House_-_Dec_2008.jpg/640px-Sydney_Opera_House_-_Dec_2008.jpg",
description: "A exposure blended photo of the Sydney Opera House, as viewed from the Sydney Harbour Bridge. Taken by myself with a Canon 5D and 100mm f/2.8 macro lens.",
date: "2 December 2008",
author: "David Iliff",
license: "CC-BY-SA 3.0",
wikimedia: "http://commons.wikimedia.org/wiki/File:Sydney_Opera_House_-_Dec_2008.jpg"
}
];
// Update the image and details for the city that is currently selected
function updateCity() {
var theCity = document.getElementById("selectCity").value;
var index = document.getElementById("selectCity").selectedIndex;
alert (theCity + " has been selected at index " + index);
if...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.