Free Training
C Language   |   CSS   |   MainFrame   |   VBScript   |   PHP   |   XML   |   C++ Tutorials   |   Ajax   |   JavaScript   |   CSS3   |   UML   |   jQuery   |   Microsoft AJAX

Sponsored Links

JavaScript Tutorials

 
Home Tutorials JavaScript
 

JavaScript Browser Objects Part 2

 

JavaScript Browser Objects Part 2

Page 1 of 2

JavaScript Browser Objects Part 2

In 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().


button object:

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.


Properties of button object:

The following are the properties associated with button object:


  • form
  • name
  • value

form:

form property of button object denotes the form object that includes the button.


name:

name property of button object denotes the name of the button.


value:

value property of button object denotes the value of the button that appears on the button.


Methods of button object:

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


Read Next: JavaScript Introduction

 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links