Friday 10, February 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    Forum    |    About Us    |    Contact Us

Events

JavaScript Events are items that transpire based on an action. A document event is the loading of an HTML document. A form event is the clicking on a button. Events are objects with properties.

Example:









Hover Me!


With the button we used the event onClick event as our desired action and told it to call our popup function that is defined in our header. To call a function you must give the function name followed up with parenthesis "()".

The HTML 4 specification refers to these as intrinsic events and defines 18 as listed below:

Event Handler

Event that it handles

onBlur

User has left the focus of the object. For example, they clicked away from a text field that was previously selected.

onChange

User has changed the object, then attempts to leave that field (i.e. clicks elsewhere).

onClick

User clicked on the object.

onDblClick

User clicked twice on the object.

onFocus

User brought the focus to the object (i.e. clicked on it/tabbed to it)

onKeydown

A key was pressed over an element.

onKeyup

A key was released over an element.

onKeypress

A key was pressed over an element then released.

onLoad

The object has loaded.

onMousedown

The cursor moved over the object and mouse/pointing device was pressed down.

onMouseup

The mouse/pointing device was released after being pressed down.

onMouseover

The cursor moved over the object (i.e. user hovers the mouse over the object).

onMousemove

The cursor moved while hovering over an object.

onMouseout

The cursor moved off the object

onReset

User has reset a form.

onSelect

User selected some or all of the contents of the object. For example, the user selected some text within a text field.

onSubmit

User submitted a form.

onUnload

User left the window (i.e. user closes the browser window).

The events in the above table provide you with many opportunities to trigger some JavaScript from within your HTML code.

 
     
   
JavaScript Tutorial
 
  Introduction
Introduction
  Object Oriented Programming
Object Oriented Programming
  How to
How to
  Where use JavaScript
Where use JavaScript
  Variables
Variables
  Operators
Operators
  if Statement
if Statement
  Switch Statement
Switch Statement
  Functions
Functions
  for Loop
for Loop
  while Loop
while Loop
  Popup Boxes
Popup Boxes
  break and continue Statements
break and continue Statements
  Events
Events
  Date and Time Object
Date and Time Object
  Special Characters
Special Characters
 
 
 
Web Designing Tutorials
  HTML Tutorial
HTML Tutorial
  DHTML Tutorial
DHTML  Tutorial
  CSS Tutorial
CSS Tutorial
  XHTML Tutorial
XHTML Tutorial
 
Programming Languages Tutorials
  C Language Tutorial
C Language Tutorial
  C++ Tutorial
C++ Tutorial
  Java Language Tutorial
Java Language Tutorial
  Data Structure Theory Tutorial
Data Structure Theory Tutorial
 
Server Side Scripting Tutorials
  PHP Tutorial
PHP Tutorial
  SQL Tutorial
SQL Tutorial
  ASP Tutorial
ASP Tutorial
 
Client Side Scripting Tutorials
  JavaScript Tutorial
JavaScript Tutorial
  VBScript Tutorial
VBScript Tutorial
 
 
 
POPULAR E-BOOKS
 
Download PHP Essentials  Ebook PHP Essentials
   
Download How To Start The Life Of Your Dreams Ebook How To Start The Life Of Your Dreams
   
Download The Greatest Marketing Secrets of the Ages Ebook The Greatest Marketing Secrets of the Ages
   
Download Enhance Your Financial Intelligence Ebook Enhance Your Financial Intelligence
   
Download Restore Your Computer in a Few Minutes Ebook Restore Your Computer in a Few Minutes
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz