Helping ordinary people create extraordinary websites!
GET OUR NEWSLETTER
Your Email:
 

Essential Javascript -- A Javascript Tutorial

By Patrick Hunlock
2007-12-02


Javascript is an Event Driven Language

As you can tell from the input examples, Javascript is an event driven language which means your scripts react to events you set up. Your code isn't running all the time, it simply waits until an event starts something up! Going into all the Javascript events is beyond the scope of this document but here's a short-list of common events to get you started.

EventDescription
onAbortAn image failed to load.
onBeforeUnloadThe user is navigating away from a page.
onBlurA form field lost the focus (User moved to another field)
onChangeThe contents of a field has changed.
onClickUser clicked on this item.
onDblClickUser double-clicked on this item.
onErrorAn error occurred while loading an image.
onFocusUser just moved into this form element.
onKeyDownA key was pressed.
onKeyPressA key was pressed OR released.
onKeyUpA key was released.
onLoadThis object (iframe, image, script) finished loading.
onMouseDownA mouse button was pressed.
onMouseMoveThe mouse moved.
onMouseOutA mouse moved off of this element.
onMouseOverThe mouse moved over this element.
onMouseUpThe mouse button was released.
onResetA form reset button was pressed.
onResizeThe window or frame was resized.
onSelectText has been selected.
onSubmitA form's Submit button has been pressed.
onUnloadThe user is navigating away from a page.

These events can be attached to most any HTML tag or form element. Of them all onClick will probably be what you end up using most often.



Tutorial Pages:
» Essential Javascript -- A Javascript Tutorial
» Getting Started
» In-Line Javascript
» External Javascript
» Javascript is case sensitive
» Output (writeln)
» Output (alert)
» Output (getElementById)
» Input (One Click To Rule Them All)
» Input (User Input)
» Javascript is an Event Driven Language
» Comments
» Variables
» Variable Scope
» Special Keywords
» Arithmetic Operators
» Logical and Comparison Operators
» JavaScript Conditionals: IF
» JavaScript Conditionals: SWITCH
» JavaScript Conditionals: Shorthand Assignment
» JavaScript Conditionals: Ternary Operators
» JavaScript Loops: FOR
» JavaScript Loops: FOR/IN
» JavaScript Loops: WHILE
» Bringing It All Together
» DHTML: Dynamic HTML
» Conclusion


copyright © 2006, 2007 by Patrick Hunlock


 | Bookmark
Related Tutorials:
» JavaScript Debugging Techniques with Firebug
» Striped Tables Using JavaScript
» Opening PDFs in a New Window with JavaScript
» Submit Forms Conditionally using JavaScript
» How to Setup a Randomising Function
» Introduction to JavaScript Tutorial

Advertise with Us!


Tutorials Scripts Web Hosting Developer Manuals
Resources