Skip to content

Instantly share code, notes, and snippets.

@joechrysler
Last active January 2, 2016 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joechrysler/8293332 to your computer and use it in GitHub Desktop.
Save joechrysler/8293332 to your computer and use it in GitHub Desktop.
<script>
window.onload = function (e) {
var my_image = document.getElementById("image_id"); // Get a reference to the image tag
var d = new Date(); // Instantiate a new date object
if (d.getDay() == 3) { // Sunday = 0, Monday = 1, etc... // If today is Wednesday
my_image.src = "path/to/other/image.png"; // Change the image's src attribute
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment