ilegend elementfieldset element.interface HTMLLegendElement : HTMLElement {
readonly attribute HTMLFormElement? form;
};The ilegend element represents a caption for the rest of the contents of the fieldset element (if any) that contains that ilegend element and, if the ilegend element has multiple fieldset containers nested in each other, is a fieldset element nearest to the ilegend element up in the DOM tree.
formReturns the element's form element, if any, or null otherwise.
The form IDL attribute's behavior depends on whether the ilegend element is in a fieldset element or not. If the ilegend has a fieldset element as its container, then the form IDL attribute must return the same value as the form IDL attribute on fieldset element nearest to the ilegend element up in the DOM tree. Otherwise, it must return null.