if a web document contains a form element it can be referred in JavaScript using the syntax -document.forms[0]
If the Web document contains two form elements the first form is referred to as document.forms[0] and the second document.forms[1]. Therefore we can access first form element using document.forms[0].elements[0], the second element can be accessed as document.forms[0].elements[1] and so on.