How to access elements using javascript?

How to Accessing Elements using javascript?

The elements of JavaScript are accessed by their names. By default the browser is accessed by the element ‘windows’ and the page by ‘document’. The corresponding element has user defined names for forms and its elements.

For example
var passwd = windows.document.frmLogin.password.value;
assigns the value of the password field of the form fromLogin in the current document, where password is the name of the element and frmLogin is the name of the form. Like wise any form element is accessed.

How to Accessing Elements using javascript?

Following are some of the functions with which the elements can be retrieved:

- getElementById()
- getElementByName()
- getElementByValue()
- getElementByTag()
JavaScript - Difference between undefined value and null value
Difference between undefined value and null value - ...
How to set the cursor to wait in JavaScript?
The cursor can set to wait in JavaScript by using the property ‘cursor’ property.
What is decodeURI(), encodeURI() in JavaScript?
What is decodeURI(), encodeURI() in JavaScript? - ...
Post your comment