Okay, so we learnt that JavaScript uses a heirarchical dot notation to refer to objects. In addition to the name property, objects can have other properties.
For example, an image located in a document is an object and has the following properties:
To refer to the source of an image named logo we use:
document.logo.src
Similarly, its width is refered as:
document.logo.width
Different HTML elements have different properties. For example, a text field form object has the following properties:
To set the value of a text field, we use the = (equal too) operator as:
document.contactform.add.value = "Type your address here";
This is a JavaScript statement that instructs the browser to displays the text Type your address here in the text field add.
![]()
Page contents: Javascript objects and properties - online javascript help - javascript help tutorial
Comments, questions, feedback... whatever!