Note to self (from SO):

document.addEventListener("DOMContentLoaded", function() {
  // code...
});

Labels: , ,