Skip to content

Instantly share code, notes, and snippets.

@jpetto
Created February 11, 2014 03:30
Show Gist options
  • Save jpetto/8928835 to your computer and use it in GitHub Desktop.
Save jpetto/8928835 to your computer and use it in GitHub Desktop.
ASWM - HW 1 - Helper code
;(function() {
'use strict';
// get a reference to the element with the id 'mountain-image'
var mountain_image = document.querySelector('#mountain-image');
// get a reference to the element with the id 'mountain'
// TODO 1
// add a click event listener to the mountain_image element
mountain_image.addEventListener('click', function(e) {
// using the classList API, toggle the 'episode-open' class on the mountain element
// see the week 2 notes for a demonstration of the classList APIs toggle function
// TODO 2
});
// repeat the above for the other two images on the page ('marge-image' and 'plow-image')
// TODO 3
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment