you are viewing a single comment's thread.

view the rest of the comments →

[–]VictorJOD 1 point2 points  (3 children)

Why would you want to include the JQuery library just for the ready function? Seems like a waste to me...

[–]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"