Thursday, September 16, 2004

HTML Events Objectwise

All HTML Events


1

Anchor Object

The Anchor object represents an HTML a element (a hyperlink).

For each instance of an HTML <a> tag in a document, an Anchor object is created.

An anchor can be used in two ways:

  1. To create a link to another document by using the href attribute
  2. To create a bookmark inside a document, by using the name attribute

All Anchor objects in a document can be found in the Document object's anchors array.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the link loses focus 2 3
onFocus Executes some code when the link gets focus 2 3

2

Area Object

The Area object defines an area of an image-map. An image-map is an image with clickable regions.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onClick Executes some code when a Click event occurs 3 4
onDblClick Executes some code when a Doubleclick event occurs 3 4
onMouseOut Executes some code when a Mouseout event occurs 3 4
onMouseOver Executes some code when a Mouseover event occurs 3 4

3

Button Object

The button object represents a push button on an HTML form.

For each instance of an HTML <input type="button"> tag on an HTML form, a Button object is created.

The Button objects are stored in the elements array of the corresponding form. You can access a Button object by indexing this array - either by number (0 represents the first element in a form) or by using the value of the name attribute.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the button loses focus 2 3
onClick Executes some code when the button is clicked 2 3
onFocus Executes some code when the button gets focus 2 3
onMouseDown Executes some code when a mouse button is pressed 4 4
onMouseUp Executes some code when a mouse button is released 4 4

4

Checkbox Object

The Checkbox object represents a checkbox on an HTML form.

For each instance of an HTML <input type="checkbox"> tag on an HTML form, a Checkbox object is created.

All Checkbox objects are stored in the elements array of the corresponding form. You can access a Checkbox object by indexing this array - either by number (0 represents the first element in a form) or by using the value of the name attribute.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the checkbox loses focus 2 3
onClick Executes some code when the checkbox is clicked 2 3
onFocus Executes some code when the checkbox gets focus 2 3
onMouseDown Executes some code when a mouse button is pressed 4 4
onMouseUp Executes some code when a mouse button is released 4 4

5

Document Object

The Document object is used to access all elements in a page.

Events

Syntax: document.event_name="someJavaScriptCode"

Event Description NN IE W3C
onClick Executes some code when a Click event occurs 6 5
onDblClick Executes some code when a Doubleclick event occurs 6 5
onFocus Executes some code when a Focus event occurs 6 5
onKeyDown Executes some code when a Keydown event occurs 6 5
onKeyPress Executes some code when a Keypress event occurs 6 5
onKeyUp Executes some code when a Keyup event occurs 6 5
onMouseDown Executes some code when a Mousedown event occurs 6 5
onMouseMove Executes some code when a Mousemove event occurs 6 5
onMouseOut Executes some code when a Mouseout event occurs 6 5
onMouseOver Executes some code when a Mouseover event occurs 6 5
onMouseUp Executes some code when a Mouseup event occurs 6 5
onResize Executes some code when a Resize event occurs 6 5

6

FileUpload Object

For each instance of an HTML <input type="file"> tag on a form, a FileUpload object is created.

All FileUpload objects are stored in the elements array of the corresponding form. You can access a FileUpload object by indexing this array - either by number (0 represents the first element in a form) or by using the value of the name attribute.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description NN IE W3C
onBlur Executes some code when the FileUpload object loses focus 3 4
onClick Executes some code when the FileUpload object gets a mouse click 3 4
onFocus Executes some code when the FileUpload object gets focus 3 4
onSelectStart Executes some code when the FileUpload object gets selected 4

7

Form Object

Forms are used to prompt users for input. We may use form elements such as text fields, radio buttons, checkboxes and selection lists. The input data is normally posted to a server for processing.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onReset Executes some code when a Reset event occurs 3 4
onSubmit Executes some code when a Submit event occurs 2 3

8

Frame Object

The Frame object represents an HTML frame.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the frame loses focus 5 No
onFocus Executes some code when the frame gets focus 5 No

9

Frameset Object

The Frameset object represents an HTML frameset.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the frameset loses focus 5 No
onFocus Executes some code when the frameset gets focus 5 No

10

IFrame Object

The IFrame object represents an HTML inline-frame.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the iframe loses focus 5 No
onFocus Executes some code when the iframe gets focus 5 No

11

Image Object

The Image object represents an HTML img element.

For each instance of an HTML <img> tag in a document, an Image object is created.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onAbort Executes some code when a user aborts the download of an image 3 4
onBlur Executes some code when the image loses focus 4
onClick Executes some code when a user clicks on the image 4
onError Executes some code when an Error occurs 3 4
onFocus Executes some code when the image gets focus 4
onLoad Executes some code when the image loads 3 4

12

Link Object

The Link object represents the HTML link element. The link element can only be used within the <head> tag.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onLoad Executes some code after the browser loads the link object 2 4

13

Password Object

For each instance of an HTML <input type="password"> tag on a form, a Password object is created.

All Password objects are stored in the elements array of the corresponding form. You can access a Password object by indexing this array - either by number (0 represents the first element in a form) or by using the value of the name attribute.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the password field loses focus 2 4
onClick Executes some code when the user clicks in the password field 4
onFocus Executes some code when the password field gets focus 2 3.02
onKeyDown Executes some code when a key is pressed down in the password field 4 4
onKeyPress Executes some code when an alphanumeric key is pressed in the password field 4 4
onKeyUp Executes some code when a key is released in the password field 4 4
onSelectStart Executes some code when some text in the password field is selected 4

14

Radio Object

For each instance of an HTML <input type="radio"> tag on a form, a Radio object is created.

All Radio objects are stored in the elements array of the corresponding form. You can access a Radio object by indexing this array - either by number (0 represents the first element in a form) or by using the value of the name attribute.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the radio button loses focus 2 4
onClick Executes some code when the user clicks on the radio button 4
onFocus Executes some code when the radio button gets focus 2 3.02
onSelectStart Executes some code when the radio button is selected 4

15

Reset Object

For each instance of an HTML <input type="reset"> tag on a form, a Reset object is created.

All Reset objects are stored in the elements array of the corresponding form. You can access a Reset object by indexing this array - either by number (0 represents the first element in a form) or by using the value of the name attribute.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the reset button loses focus 2 4
onClick Executes some code when the user clicks on the reset button 4
onFocus Executes some code when the reset button gets focus 2 3.02
onSelectStart Executes some code when the reset button is selected 4

16

Select Object

For each instance of an HTML <select> tag on a form, a Select object is created.

All Select objects are stored in the elements array of the corresponding form. You can access a Select object by indexing this array - either by number (0 represents the first element in a form) or by using the value of the name attribute.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the dropdown list loses focus 2 3.02
onChange Executes some code when the dropdown list loses focus and its value has altered 2 3.02
onClick Executes some code when the user clicks the left mouse button in the dropdown list 4
onFocus Executes some code when the dropdown list gets focus 2 4

17

Submit Object

For each instance of an HTML <input type="submit"> tag on a form, a Submit object is created.

All Submit objects are stored in the elements array of the corresponding form. You can access a Submit object by indexing this array - either by number (0 represents the first element in a form) or by using the value of the name attribute.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the submit button loses focus 4
onClick Executes some code when the user clicks on the submit button 2 4
onFocus Executes some code when the submit button gets focus 3.02
onSelectStart Executes some code when the submit button is selected 4 4

18

Table Object

The Table object represents an HTML table element.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the table loses focus 4
onClick Executes some code when the user clicks on the table 4
onFocus Executes some code when the table gets focus 4
onSelectStart Executes some code when the table is selected 4

19

TableData Object

The TableData object represents an HTML td element.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the table cell loses focus 4
onClick Executes some code when the user clicks on the table cell 4
onFocus Executes some code when the table cell gets focus 4
onSelectStart Executes some code when the table cell is selected 4

20

TableHeader Object

The TableHeader object represents an HTML th element.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the table header cell loses focus 5
onClick Executes some code when the user clicks on the table header cell 4
onFocus Executes some code when the table header cell gets focus 5
onSelectStart Executes some code when the table header cell is selected 4

21

TableRow Object

The TableRow object represents an HTML tr element.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the table row loses focus 4
onClick Executes some code when the user clicks on the table row 4
onFocus Executes some code when the table row gets focus 4
onSelectStart Executes some code when the table row is selected 4

22

Text Object

For each instance of an HTML <input type="text"> tag on a form, a Text object is created.

All Text objects are stored in the elements array of the corresponding form. You can access a Text object by indexing this array - either by number (0 represents the first element in a form) or by using the value of the name attribute.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the text field loses focus 2 4
onChange Executes some code when the text field loses focus and its value has altered 2 3.02
onClick Executes some code when the user clicks the left mouse button in the text field 4
onFocus Executes some code when the text field gets focus 2 3.02
onKeyDown Executes some code when a key is pressed in the text field 4 4
onKeyPress Executes some code when an alphanumeric key is pressed in the text field 4 4
onKeyUp Executes some code when a key is released in the text field 4 4
onSelect Executes some code when the current selection is changed in the text field 2 3.02
onSelectStart Executes some code when some text in the text field is selected 4

23

Textarea Object

For each instance of an HTML <textarea> tag on a form, a Textarea object is created.

All Textarea objects are stored in the elements array of the corresponding form. You can access a Textarea object by indexing this array - either by number (0 represents the first element in a form) or by using the value of the name attribute.

Events

Syntax: object.event_name="someJavaScriptCode"

Event Description N IE W3C
onBlur Executes some code when the textarea loses focus 2 3.02
onChange Executes some code when the textarea loses focus and its value has altered 2 3.02
onClick Executes some code when the user clicks the left mouse button in the textarea 4
onFocus Executes some code when the textarea gets focus 2 3.02
onKeyDown Executes some code when a key is pressed down in the textarea 4
onKeyPress Executes some code when a key is pressed in the textarea 4
onKeyUp Executes some code when a key is released in the textarea 4
onSelect Executes some code when some text in the textarea is selected 2

24

Window Object

The Window object corresponds to the browser window. A Window object is created automatically with every instance of a <body> or <frameset> tag.

Events

Syntax: window.event_name="someJavaScriptCode"

Event Description N IE
onBlur Executes some code when a Blur event occurs 3
onError Executes some code when an Error event occurs 3
onFocus Executes some code when a Focus event occurs 3
onLoad Executes some code when an Load event occurs 2
onResize Executes some code when a Resize event occurs 4
onUnload Executes some code when an Unload event occurs 2


No comments: