devxlogo

Call More Than One Function With a Single Event Handler

Call More Than One Function With a Single Event Handler

It is possible to call two different functions when only a single event has occurred; for example, when the user has clicked on a particular button, or when your page initially loads. To do that, make sure to place a semicolon between the two function calls. At load time, for example, you might want to call an init() function to initialize variables, and a setHidden() function to set the visibility of certain objects. To do that, place a semicolon between the two function calls, as in:

 
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist