In JavaScript you are given the default object called Window. Within the Window, there is the HTML Document. On the HTLM document we have our HTML elements, like images, forms, links etc. You can refer to an HTML tag using its element number or its NAME attribute. So, if I have a browser window, and in the window is a document, and on the document is an image I could access the source property of that image by:
document.images[0].src document.imageName.src document[imageName].src
document.images[0].height height
document.images[0].width width
document.images[0].src src
Want to change the back ground color? blue red white
document.linkColor="color"; link color
document.alinkColor="color";active link color
document.vlinkColor="color";visited link color
I use the title tag to build the top part of each section of this web site.
click here to see the demo.
document.forms[0].elements[0].value="new value"
document.formName.elements[0].value="new value"
document.forms[0].buttonName.value="new value"
document.formName.buttonName.value="new value"