document.forms.my // the form with name="my"
document.forms[0] // the first form in the document
<form name="my">
	<input name="one" value="1">
	<input name="two" value="2">
</form>
let form = [document.forms.my](<http://document.forms.my/>);
let elem = form.elements.one; // <input name="one"> element
console.log(elem.value); // 1

let ageElems = form.elements.age;
console.log(ageElems[0].value); // 10, the first input value
<form id="form">
<fieldset name="userFields">
<legend>info</legend>
<input name="login" type="text">
</fieldset>
</form>
alert(form.elements.login); // <input name="login">
let fieldset = form.elements.userFields;
alert(fieldset); // HTMLFieldSetElement
// we can get the input both from the form and from the fieldset
alert(fieldset.elements.login == form.elements.login); // true
<form id="form">
	<input type="text" name="login">
</form>
// form -> element
let login = form.login;
// element -> form
alert(login.form); // HTMLFormElement

Form Elements

  1. select.options – the collection of <option> elements,
  2. select.value – the value of the chosen option,
  3. select.selectedIndex – the number of the selected option.