
|
OBJECT:
Button
A Button
object is created with every instance of an HTML <INPUT> tag (with a 'type' value set as 'button') on a form. These objects are then stored in the elements array of the parent form and accessed using either the name defined within the HTML tag or an integer (with '0' being the first element defined, in source order, in the specified form).
PROPERTIES
form Property
This property returns a reference to the button's parent form.
Syntax: button.form
name Property
This property sets or returns the value of the button's name attribute.
Syntax: button.name
type Property
Every element on a form has an associated type property. In the
case of a Button object, the value of this property is always "button".
Syntax: button.type
value Property
This property sets or returns the button's value attribute. This
is the text that is actually displayed on the button face.
Syntax: button.value
METHODS
blur Method
This method removes the focus from the specified Button
object.
Syntax: button.blur( )
click Method
This method simulates a mouse-click on the button.
Syntax: button.click( )
focus Method
This method gives focus to the specified Button object.
Syntax: button.focus( )
handleEvent Method
This method calls the handler for the specified event.
Syntax: button.handleEvent(event)
EVENT HANDLERS
onBlur Event handler
This event handler executes some specified JavaScript code on the occurance of a blur event (when the button object loses focus).
Syntax: button.onBlur="myJavaScriptCode"
onClick Event handler
This event handler executes some specified JavaScript code on the occurance of a click event (when the button object is clicked).
Syntax: button.onClick="myJavaScriptCode"
onFocus Event handler
This event handler executes some specified JavaScript code on the occurance of a focus event (when the button object receives focus).
Syntax: button.onFocus="myJavaScriptCode"
onMouseDown Event handler
This event handler executes some specified JavaScript code on the occurance of an onMouseDown event (when a mouse button is depressed).
Syntax: button.onMouseDown="myJavaScriptCode"
onMouseUp Event handler
This event handler executes some specified JavaScript code on the occurance of an onMouseUp event (when a mouse button is released).
Syntax: button.onMouseUp="myJavaScriptCode"
Copyright 1999 by Infinite Software Solutions, Inc.
Trademark Information |