Skip to content

Instantly share code, notes, and snippets.

@kvu787
Last active December 24, 2015 03:39
Show Gist options
  • Save kvu787/6738422 to your computer and use it in GitHub Desktop.
Save kvu787/6738422 to your computer and use it in GitHub Desktop.
see comments
// Visit courses.cs.washington.edu/courses/cse143/13au/homework.shtml or
// https://courses.cs.washington.edu/courses/cse143/13au/homework.shtml and run
// this snippet of JavaScript to display otherwise hidden homework assignments.
//
// Note that the revealed assignments are probably old ones.
(function () {
"use strict";
// display commented content
var newHTML = document.getElementsByTagName('html')[0].innerHTML;
document.getElementsByTagName('html')[0].innerHTML = newHTML.replace(/(<!--)|(-->)/g, '');
// display elements with 'delayed' class
var delayedElements = document.getElementsByClassName('delayed');
for (var i = 0; i < delayedElements.length; i++) {
delayedElements[i].setAttribute('style', 'display: block');
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment