The HTMLFormElement.length read-only property returns the number of controls in the form element.
HTMLFormElement.length
MDN Reference