Jump to content

Beginner JS question: event handlers


Recommended Posts

Yes. As you said, separating semantics, presentation, and behavior makes for a cleaner, more easily maintained document.If you have other things that need doing onpageload, you might want to have a separate function called "initialize_controls" (or something similar) and all your event handlers get assigned in there. The init function would call initialize_controls only once.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...