Form JavaScript Tutorial

The Button object represents a graphical button.
Buttons are created as part of a form by using the tag with the TYPE attribute set to button in an HTML document.
Once created, buttons can be accessed in JavaScript as an element of a form using dot notation.
Arguments, Properties, Methods, and Event Handlers Associated with the Button Object are listed in the following table.
formReturns the form object of a button.
nameThe string specified in the NAME attribute of the HTML tag.
typeThe string specified in the TYPE attribute of the HTML tag. This string is always button for the Button object.
valueThe string that appears in the graphical representation of a button.
blur()Removes focus from a button.
click()Calls the button's onClick event handler.
focus()Applies focus to a button.
handleEvent()Passes an event to the appropriate event handler associated with a button.
onBlurThe handler invoked when focus is removed from a button.
onClickThe handler invoked when a button is clicked.
onFocusThe handler invoked when focus is applied to a button.
onMouseDownThe handler invoked when the mouse is clicked to select a button.
onMouseUpThe handler invoked when the mouse is clicked to unselect a button.


    

The Button NAME Property


    
                   value="Press here to see the name of this button"
             name="myBigButton"
             onClick="displayButtonName()">
                   name="textBox">