HTML | DOM Legend form Property Last Updated : 25 Aug, 2022 Comments Improve Suggest changes Like Article Like Report The DOM Legend form Property is used for returning a reference to the form that contains the <legend> tag. It is read-only Property that returns a form Object on success. Syntax: legendObject.form Return value: A reference to <form> element containing the <legend> element. If <legend> element is not in a form, null is returned. Example: This Example returns a form Property. HTML <!DOCTYPE html> <html> <head> <title>DOM Legend form Property</title> <style> form { width: 50%; } label { display: inline-block; float: left; clear: left; width: 90px; margin: 5px; text-align: left; } input[type="text"] { width: 250px; margin: 5px 0px; } .gfg { font-size: 40px; color: green; font-weight: bold; } </style> </head> <body> <div class="gfg">GeeksforGeeks</div> <h2>DOM Legend Form Property</h2> <form id="myGeeks"> <fieldset> <!-- Assigning legend id --> <legend id="GFG">STUDENT::</legend> <label>Name:</label> <input type="text"> <br> <label>Email:</label> <input type="text"> <br> <label>Date of birth:</label> <input type="text"> <br> <label>Address:</label> <input type="text"> <br> <label>Enroll No:</label> <input type="text"> </fieldset> </form> <br> <button onclick="myGeeks()">Submit</button> <p id="sudo" style="font-size:25px;"></p> <script> function myGeeks() { // return legend form Pfoperty var g = document.getElementById("GFG").form.id; document.getElementById( "sudo").innerHTML = g; } </script> </body> </html> Output:Before Clicking On Button: After Clicking On Button: Supported Browsers: Google Chrome Mozilla FirefoxEdge Opera Safari Comment More infoAdvertise with us Next Article HTML DOM Legend align Property M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML DOM Label form Property The HTML DOM Label form Property is used for returning the reference to the form containing the Label Element. It is read-only Property that returns a form object on success. Syntax: labelObject.form Return Value: It returns a reference that contains the label and null if the label is not in the for 1 min read HTML | DOM Object form Property The DOM Object form Property in HTML DOM is used to set or return the value of the form attribute of an <object> element. The form attribute is used to specify the one or more forms the <object> will contain. Syntax: It returns the form property.objObject.formIt is used to set the form p 1 min read HTML | DOM Input Image form Property The HTML DOM Input Image form Property is used for returning the reference to the form containing the input image field. It is a read-only property that returns a form object on success. Syntax: imageObject.form.id Return Values: It returns a string value which specify the reference of the form cont 1 min read HTML DOM Legend align Property The Legend align Property in HTML DOM is used to set or return the value of the align attribute of <legend> Element. Note: This property is no longer supported in HTML5. Syntax: It returns a legend align Property. Legendobject.align;It sets the Legend to align Property. Legendobject.align="lef 3 min read HTML DOM Legend Object The DOM Legend Object is used to represent the HTML <legend> element. The legend element is accessed by getElementById(). Properties: Form: it is used to return the reference of the form that contains the legend element. Syntax: document.getElementById("ID">); Where âidâ is the ID assigned 2 min read HTML DOM Legend Object The DOM Legend Object is used to represent the HTML <legend> element. The legend element is accessed by getElementById(). Properties: Form: it is used to return the reference of the form that contains the legend element. Syntax: document.getElementById("ID">); Where âidâ is the ID assigned 2 min read Like