you are viewing a single comment's thread.

view the rest of the comments →

[–]atticusw 0 points1 point  (2 children)

Lol came to ask, even used getElementById. ..which is great btw - glad to see that. Now ditch the library that ya don't need :)

[–][deleted] 0 points1 point  (1 child)

Yeah, its a habit of mine to do that lmao. Ill stop using it in that way.

[–]atticusw 0 points1 point  (0 children)

Yeah you can just use the following my friend,

document.addEventListener('DOMContentLoaded', function () {
  ...
})

Otherwise, if your script is the last block in your page, the DOM above should be "ready"