JavaScript Class
Event Handlers
Events are how we trigger JavaScript to do something. Most everything that a visitor of your site does, can be an event. For example, if a user clicks somewhere on a page with their mouse, that's an event. If a user loads or refreshes the page, that's an event.
Below is a list of some of the more commonly used event Handlers and their descriptions:
- onBlur
- occurs when a select, text, or textarea form item is acted upon and then moved off of by the user. In other words, the user loses focus on the item.
- onChange
- occurs when the text in a select, text, or textarea form item is altered by the user. Usually this command is used to check what the user has entered for errors.
- onClick
- occurs when the user clicks on an object such as a link.
- onFocus
- occurs when the user selects a text, textarea, or select form item. In other words, the user focuses on that item.
- onLoad
- acts to trigger a function when the page loads. The command is placed in the BODY portion of the HTML document.
- onMouseOut
- used within the hypertext link to create text when the mouse is moved off of the item. It is most often used in conjunction with onMouseOver.
- onMouseOver
- used within the hypertext link that reacts when the user passes a mouse pointer over the link text.
- onSelect
- activated when the user highlights text in a text or textarea form item.
- onSubmit
- activated when the user clicks on a form submit button
- onUnload
- placed inside the BODY command of the HTML document and either calls for a function or contains the command to stop a function from running when the user unloads, or leaves, the page
Also see...
HTML Events
|