JavaScript is a very popular scripting/programming languages used by web developers worldwide to code client-side scripts that allow for various types of interactivity on web pages. JavaScript event handlers are a major part of working with this language and those who wish to learn to work with them should first understand what they are and what they can and cannot do.
An event is some type of action that is carried out by the web page visitor, the web browser, or perhaps even by another script. For example, when you move the mouse over an image or over a link, that is an event. A handler is a mechanism or a way to both capture and respond to an event. If the web developer wants an image to change when the mouse is hovered overed it, he or she can respond to such an event via JavaScript event handlers. They are written right in line with hypertext mark-up language (HTML) and used to interact with visitors in a variety of ways.
What Are Specific JavaScript Event Handlers?
There are various JavaScript event handlers to handle various actions and to allow a response to them. Some are used much more than others. Among the most popular JavaScript event handlers are: JavaScript onLoad, onMouseover, onMouseout, onClick and onSubmit. Remember, there's an event and there's a way to handle that event. The following description of JavaScript event handlers breaks this down a little better:
Event name: Load
Action: browser loading a web page
Event handler name: onLoad
Event name: Mouseover
Action: mouse moved over object in window
Event handler name: onMouseover
Event name: Mouseout
Action: moused moved off of an object
Event handler name: onMouseout
Event name: Click
Action: mouse button clicked
Event handler name: onClick
Event name: Submit
Action: a form is submitted (ie. contact form)
Event handler name: onSubmit
There are other JavaScript event handlers that are not used as often as these. They include: onReset, onFocus, onBlur, and onChange. The onReset handler resets a form such as a contact or registration form that has been completed. When a visitor changes selected data or data that is contained in a form element, this action or event is called "change." Focus refers to a visitor making a specific form element or an entire window active by clicking on it with a pointing device such as a mouse or by tabbing to it. Blur is simply the removal of focus.
You may have noticed that when visiting some web sites and wishing to enjoy certain kinds of interactivity, it is necessary to have JavaScript enabled so the scripts can run. Usually this is not a problem as it is generally enabled by default in your browser. However, you can disable it if you'd like and don't need it.
Source:
AAS - Web Development
Published by Ana Kirk
Ana Kirk is an emergency medical technician (EMT) and part-time web developer. She is also a back-up translator and author of study materials for a Christian ministry. View profile
- Important Steps Before You Hire a PHP Web Development ServiceThere is no doubt that PHP has made a place amongst the popular programming languages, and the with the boom in the web designing and development industry, more and more web development companies are going for the web...
- Web Development Company Makes Your Online Business More SuccessfulAs the web world is growing day by day, and you can find numerable number of websites, e-commerce shops, various platforms. The competition is growing stiff and so as to maintain a recognition...
- Outsourcing Web Development Services in IndiaThe growing influential aspect of the Internet and globalisation go hand in hand. And where, there is no denial to the fact that the current scenario that avails us with the opportunity of sustainable technology.
- Why You Should Outsource Web DevelopmentOutsourcing helps save money on web development.
- PHP Web Development Companies & Their ServicesOwing a website in today's scenario, where the marketeers are looking forward to establishing themselves in the web industry is very common. On the same side..
- Functional Javascript
- Disabling Right-Click Clipboard Operations on a Web Site: A Wise Decision?
- Who Are the "Mormons" Really?
- The Party at the End of the World
- Sharity
- Microsoft to Begin Offering Free Web Development Tools
- How to Choose a Web Development Company




