Event Handlers
2. HTML Events
Current Web sites are designed to be able to react or process users' interaction with the webpages or something that is happening with a browser. HTML Events could be when a browser opens or closes or when a user hovers on an HTML element, or when a user clicks on a button. A web page could have a process attached to certain HTML events.
Each HTML event has an attached event handler that could be used to trigger a call to a function to enable it to process these events. Event handlers are used inside the beginning tag of an HTML element. The format in using an event handler would be:
<element eventhandler = ”javascript code”>
In this lesson, we will be discussing and using only two event handlers, which are: onclick and onload. Other event handlers are available and will be discussed as we progress in the course.