Move javascript after DOM elements loaded

This (first comment line/title here) needs to happen or demo1.js could have a document.ready function wrapped around it, because the script is not looking for elements that haven’t yet been added to the page!