HTML DOM Input Image name Property Last Updated : 15 Jun, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report The HTML DOM Input Image name Property is used for setting or returning the value of the name attribute of the Input Image. The name Attribute is used to reference the form-data after submitting the form or to reference the element in JavaScript. Syntax: To returns the name Property: imageObject.nameTo sets the name Property: imageObject.name=name Property Values: Accepts a single parameter name and it specifies the name of the Input Image. Return Value: It returns a string value that represents the name of the Input Image. Example 1: This program illustrates how to return the name Property. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Image name Property </title> </head> <body style="text-align:center;"> <h1 style="color:green;"> GeeksforGeeks </h1> <h4> DOM Input Image name Property </h4> <button onclick="my_geek()"> <input id="myImage" name="myGeeks" type="image" src= "https://media.geeksforgeeks.org/wp-content/uploads/gfg-40.png" alt="Submit" formaction="#" a formtarget="#" formenctype="text/plain" width="48" height="48"> </button> <h2 id="Geek_h" style="color:green;"></h2> <script> function my_geek() { // Return the name of the Input Image Field let txt = document.getElementById( "myImage").name; document.getElementById("Geek_h").innerHTML = txt; } </script> </body> </html> Output: Example 2: This Example illustrates how to sets the name Property. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Image name Property </title> </head> <body style="text-align:center;"> <h1 style="color:green;"> GeeksforGeeks </h1> <h4> DOM Input Image name Property </h4> <button onclick="my_geek()"> <input id="myImage" name="myGeeks" type="image" src= "https://media.geeksforgeeks.org/wp-content/uploads/gfg-40.png" alt="Submit" formaction="#" a formtarget="#" formenctype="text/plain" width="48" height="48"> </button> <h2 id="Geek_h" style="color:green;"></h2> <script> function my_geek() { // set the name of the Input Image Field let txt = document.getElementById( "myImage").name = "The value of the name attribute was changed to " + "Hello Geeks"; document.getElementById("Geek_h").innerHTML = txt; } </script> </body> </html> Output: Supported Browsers: The browsers supported by HTML | DOM Input Image name Property are listed below: Google ChromeEdge 12+FirefoxOperaSafari Comment More infoAdvertise with us Next Article HTML DOM Map name Property M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML Web technologies HTML-DOM Similar Reads HTML | DOM Image name Property The Image name Property in HTML DOM is used for setting or returning the value of the name Attribute of an <image> element. Note: This property is not supported by HTML 5. Syntax: imageObject.name Property Values: name: It specifies the name of the Image. Return Value: It returns a string valu 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 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 Input Image type Property The Input Image type Property in HTML DOM is used to returning the which type of form element an image field is. Syntax: ImageObject.type Return Value: It returns a string value which represents the type of form element the Image field is. Below Example returns the Image Type Property. Example: HTML 1 min read HTML | DOM Input URL name Property The DOM Input URL name Property in HTML DOM is used to set or return the value of name attribute of a URL field. The name attribute is required for each input field. If the name attribute is not specified in an input field then the data of that field would not be sent at all. Syntax: It returns the 2 min read HTML DOM Input Image width Property The Input Image width Property In HTML DOM is used to return the value of the width attribute of the <input type="image">. Syntax: To return the width Property.imageObject.widthTo set the width Property.imageObject.width = value; Property Value: It contains the numeric value which specifies th 2 min read Like