I have been reading and practicing Javascript for the last month and so far I’m happy with it. I noticed that you can add Event Listeners and trigger a function based on that event but I also noticed that you could add an event directly to any element as an attribute, something like…

Also assigning events in javascript prevents situations when event gets fired before your script finished setting up variables and stuff, so you can first setup all stuff (load images, create variables, make sure whole page is loaded, etc..) and then assign events.