<body>
<h1>My favorite web comics.</h1>
<p>Select one from the menu<strike>, or hit random</strike>!</p>
<select id="mySelect" onchange="myFunction()">
<option value="" disabled selected style="display:none;">Select a comic!
<option id="goblins" value="Goblins">Goblins
<option id="girlGenious" value="GirlGenious">Girl Genious
<option id="grrlPower" value="GrrlPower">Grrl Power</select>
<p id="demo"></p>
<p id="image"></p>
<p id="web"></p>
<script>
var favWebComics = [
Goblins = {1: "www.goblinscomic.org"},
GirlGenious = {1: "www.girlgeniousonline.com"},
GrrlPower = {1: "www.grrlpowercomic.com"}
];
var myFunction = function() {
var x = document.getElementById("mySelect").value;
document.getElementById("demo").innerHTML = "You selected: " + x;
document.getElementById("web").innerHTML = favWebComics.x;
};
</script>
CSS
Variable(s) (10 points)
Array(s) (15 points)
For, While or Do While loop(s) (30 points)
Object(s) (25 points)
Functions / Methods (20 points)
Extra credit: (applicable to exam or homework as it is needed) Use jQuery (5 points)
Use Regular Expressions (5 points)
Use HTML / Images / CSS to make pretty (5 points)
Makes me laugh, cry or shout hallelujah (5 points)
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.