26. HTML Event Attributes

HTML Event Attributes

Window Events
Form Element Events
Keyboard Events
Mouse Events

Window Events

These attributes are valid only in body and frameset elements

Attributes Value Description
onload script Script to be run when a document loads
onunload script Script to be run when a document unloads

Form Element Event

These attributes are valid only in form element

Attributes Value Description
onchange script script to be run when the element changes
onsubmit script script to be run when the form is submitted
onreset script script to be run when the form is reset
onselect script script to be run when the element is selected
onblur script script to be run when the element loses focus
onfocus script script to be run when the element gets focus

Keyboard Events

These attributes are not valid in base,bdo,br,frame,frameset,head,html,iframe,meta,param,script,style, and title elements

Attribute VAlue Description
onkeydown script what to do when key is pressed
onkeypress script what to do when key is pressed and released
onkeyup script what to do when key is released

Mouse Events

These attributes are not valid in base,bdo,br,frame,frameset,head,html,iframe,meta,param,script,style, and title elements.

Attribute Value Description
onclick script what to do on a mouse click
ondblclick script what to do on a mouse double-click
onmousedown script what to do when mouse button is pressed
onmousemove script what to do whaen mouse pointer moves
onmouseout script what to do when mouse pointer moves out of an element
onmouseover script what to do when mouse pointer moves over an element
onmouseup script what to do when mouse button is released

No comments:

My Favorite Books

  • C and Data Structures by Ashok N. kamthane
  • Web Technologies by A. A. Puntambekar
  • Learn HTML and CSS with W3Schools
  • Learn JavaScript and Ajax with W3Schools
  • HTML5 Black Book: Covers Css3, Javascript,XML, XHTML, Ajax, PHP And Jquery
  • HTML5 Application Development Fundamentals: MTA Exam 98-375
  • .NET 4.0 Programming 6-In-1, Black Book
  • SQL Server 2008 R2 Black Book
  • Asp.net 4.0 Projects Covers: net 3.5 And .net 4.0 Codes, Black Book
  • UNIX Shell Programming 1 Edition by Yashavant Kanetkar
  • UNIX and Shell Programming 1 Edition by Richard F. Gilberg, Behrouz A. Forouzan
  • Computer Networks by Andrew S. Tanenbaum
  • Multiple Choice questions in computer science by Timothy J Williams