Sunday, September 22, 2013

Button Object

 

Events

Events
Description
onClick
Code is executed when user clicks on the button.

Properties

Properties
Description
form
References the form that contains the reset button.
accessKey
String value that sets/ returns the accessKey for the button.
name
Reflects the name of the text field (the name attribute).
id
Reflects the id of the text field (the id attribute).
type
A property available on all form elements, "type" returns the type of the calling form element, in this case, "button".
Note:
type='reset' - resets the form.
type='submit' - submits the forms and the page will refresh even with no code implementation.
disabled
Boolean value that sets/ returns whether the button is disabled.
value
A read only string that specifies the value of the button.
tabindex
The tabindex attribute specifies the tab order of an element (when the "tab" button is used for navigating).
class
The class attribute specifies one or more classnames for an element.
style
The style attribute specifies an inline style for an element.
title
The title attribute specifies extra information about an element.
The information is most often shown as a tool tip text when the mouse moves over the element.


Methods

Methods
Description
blur() Removes focus away from the button.
click() Simulates a user clicking on the form button.
focus() Sets focus on the button.