Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Source Codes E-Books Downloads Contact Us About Us

DHTML Tutorial
DHTML Introduction
DHTML CSS
DHTML DOM
DHTML Events
DHTML Summary

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


DHTML Events

Previous Next



DHTML Events

An incident which occurs in a particular place during a particular interval of time.



EVENT HANDLING

Events are represented by an event object as a member variable of the window object, such as window.event or whether as a parameter to your function

Event handlers are Javascript code that are not include inside the <script> tags, but rather, inside the html tags, that execute Javascript when some events fire, such as pressing a button, moving your mouse over a link, submitting a form, etc.

The basic syntax of these event handlers is : name_of_handler="JavaScript code here"

For example:


<a onclick="alert('Hello World!')" href="javascript:;" class="link">Click Here</a>

The above code produces the following output:

Click Here




Event Functions:

onclick:

The onclick: Event is used to invoke Javascript upon clicking a link or form boxes as in the below example:

<form name="myalertform">
<input onclick="alert('hello World')" type="button" value="Click me" name="test" class="link">
</form>

The above code produces the following output:
Clicking the above button invokes the alert function. The event handler is added within the event that it handles, like the the form button event tag.

onload:
The onload: function invokes Javascript after the page has finished loading. The below example loads a webpage, then closes it after the image has finished downloading.

onload

Displays an alert box when the page has finished loading.


onmouseover:
The onmouseover: function is used to invoke Javascript when the mouse passes over a link.
<a onmouseover="status='You activated this message when you moused over the link!';return true" onmouseout="status=' '" href="javascript:;" class="link">

Mouse over this link and look the status bar message.

</a>
The above code produces the following output:
Mouse over this link and look the status bar message.



Common Event Handlers:
Given below is a list of common Javascript event handlers:

Event Occurs when...
onabort a user aborts page loading
onblur a user leaves an object
onchange a user changes the value of an object
onclick a user clicks on an object
ondblclick a user double-clicks on an object
onfocus a user makes an object active
onkeydown a keyboard key is on its way down
onkeypress a keyboard key is pressed
onkeyup a keyboard key is released
onload a page is finished loading. Note: In Netscape this event occurs during the loading of a page!
onmousedown a user presses a mouse-button
onmousemove a cursor moves on an object
onmouseover a cursor moves over an object
onmouseout a cursor moves off an object
onmouseup a user releases a mouse-button
onreset a user resets a form
onselect a user selects content on a page
onsubmit a user submits a form
onunload a user closes a page

Here below the parameters in which they can be used

Handlers
onAbort
onBlur
onClick
onChange
onError
onFocus
onLoad
onMouseover
onMouseout
onReset
onSelect
onSubmit
onUnload
 
Can be used with these tags:
images
windows, all form elements, frames
buttons, radio buttons,checkboxes, submit buttons, links
text fields, textareas, select lists
windows, images
windows, frames, and all form elements
body, images
areas, links
links
forms
text fields, textareas
submit button
body



Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previous Next

Keywordsevent handlers, event handling listener, event handling element, event handling delegate


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.