Tutorials
JavaScriptIn this JavaScript tutorial, you will learn about Browser Objects viz button object properties of button object, form, name, value, Methods of button object, checkbox object, properties of checkbox object - checked, defaultChecked, form, name, type, value, Methods of checkbox object - blur(), click() and focus().
The button object is a browser object in JavaScript that is used to access a form button other than submit or reset. The button object is a property of the form object.
General syntax of button object in JavaScript is as follows:
<INPUT TYPE="button" NAME="some button name" VALUE="some value" onClick="Functionname">
For example:
<INPUT TYPE="button" NAME="Exforsys" VALUE="For Training Click Here!!!" onClick="TrainingFunc">
The above would create a button with a caption on the button:
For Training Click Here!!!
When the button is clicked, the function TrainingFunc is called. The function call is optional and when it is placed, the corresponding function must also be placed.
The following are the properties associated with button object:
form property of button object denotes the form object that includes the button.
name property of button object denotes the name of the button.
value property of button object denotes the value of the button that appears on the button.
The most commonly used method of button object is the click() method. The click() method invokes when the user clicks the button.
Next Page: JavaScript Checkbox Object