HTML | DOM Object name Property Last Updated : 25 Aug, 2022 Comments Improve Suggest changes Like Article Like Report The HTML | DOM Object name Property is used to set or return the value of a name attribute of an <object> element. The name attribute is used to specify the name of the embedded file. Syntax: It returns the name property objObject.nameIt is used to set the name property. objObject.name = name Property Values: It contains the value i.e name which is used to specify the name of the embedded file. Return Value: It returns a string value which represents the name of an <object> element. Example-1: This Example returns a name Property. HTML <!DOCTYPE html> <html> <body> <center> <object id="myobject" width="400" height="100" name="myGeeks" data= "https://media.geeksforgeeks.org/wp-content/uploads/geek-8.png"> </object> <h2> DOM Object name Property </h2> <p> Click the button to get the name of the embedded file. </p> <button onclick="Geeks()"> Click it </button> <p id="gfg" style="color:green; font-size:25px;"> </p> </center> <script> function Geeks() { // return Object name Property var x = document.getElementById( "myobject").name; document.getElementById( "gfg").innerHTML = x; } </script> </body> </html> Output: Before Clicking On Button: After Clicking On Button: Example-2: This Example sets the name Property. HTML <!DOCTYPE html> <html> <body> <center> <object id="myobject" width="400" height="100" name="myGeeks" data= "https://media.geeksforgeeks.org/wp-content/uploads/geek-8.png"> </object> <h2> DOM Object name Property </h2> <p> Click the button to change the name of the embedded file. </p> <button onclick="Geeks()"> Click it </button> <p id="gfg" style="color:green; font-size:25px;"> </p> </center> <script> function Geeks() { // set object name Property var x = document.getElementById( "myobject").name = "Obj1"; document.getElementById( "gfg").innerHTML = "The value of the name attribute"+ " was changed to " + x; } </script> </body> </html> Output: Before Clicking On Button: After Clicking On Button: Supported Browsers: Google Chrome Mozilla Firefox Edge Opera Safari Comment More infoAdvertise with us Next Article HTML | DOM Object name Property M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML DOM name Property The DOM name Property is used to return the name of the attribute. It is used for read-only. Syntax: attribute.name Return Value: This property returns a string value that represents the name of the attribute. Example: In this example, we are using DOM name Property for the attribute. HTML <!DOCT 1 min read HTML DOM Output name Property The Output name Property in HTML DOM is used to set or return the value of the name Attribute of an <output> element. The name Attribute is used to reference the form-data after submitting the form or to reference the element in JavaScript. Syntax: It returns the name property.outputObject.nam 2 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 Object data Property The HTML | DOM Object data Property is used to set or return the value of the data attribute of an <object> element. The data attribute is used to specify the URL of the resource which will be used by the object.Syntax: Return the data property. objObject.dataIt is used to set the data propert 1 min read HTML | DOM Parameter name Property The HTML DOM Parameter name Property is used for setting or returning the name attribute of a parameter. The name Attribute is used to reference the form-data after submitting the form or to reference the element in a JavaScript.Syntax: It return the name property. parameterObject.name It is used to 1 min read HTML DOM nodeName Property The nodeName property is used to return the name of the specified node as a string. It returns different values for different nodes such as if the node attributes, then the returned string is the attribute name, or if the node is an element, then the returned string is the tag name. It is a read-onl 2 min read HTML DOM Map name Property The Map name property in HTML DOM is used to set or return the value of the name attribute of a map element. This attribute specifies the name of the mapping image. This attribute is associated with <img> usemap attribute. It creates a relationship between the <image> and <map> ele 2 min read HTML DOM Object hspace Property The HTML DOM Object hspace property is used to set or return the value of the hspace attribute of the <object> element. The hspace attribute is used to specify the number of whitespaces for the left and right side of an Object. Syntax It returns the hspace Property. objObject.hspace; It sets t 2 min read HTML DOM Object vspace Property The HTML DOM Object vspace property is used to set or return the value of the vspace attribute of the object element. The vspace attribute is used to specify the number of whitespaces from the top and bottom sides of an object. Syntax It returns the object vspace property. objObject.vspace; It sets 2 min read HTML DOM Meta name Property The HTML DOM Meta name Property is used for returning or setting the name of the name and it is used to reference form data when it has been submitted by the user. It also refers to the element in the javascript. Syntax: It is used to return the name property.metaObject.nameIt is used to set the nam 2 min read Like