HTML DOM Input Image width Property Last Updated : 15 Jun, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report 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 the width of the image in terms of pixels. Return Value: It returns a numeric value that represents the width of the image. Example 1: This Example returns the Input Image width Property. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Image width Property </title> </head> <body style="text-align:center;"> <h1 style="color:green;"> GeeksforGeeks </h1> <h4> DOM Input Image width Property </h4> <button onclick="my_geek()"> <input id="myImage" type="image" src= "https://media.geeksforgeeks.org/wp-content/uploads/gfg-40.png" alt="Submit" formaction="#" formtarget="#" formenctype="text/plain" width="48" height="48"> </button> <h2 id="Geek_h" style="color:green;"></h2> <script> function my_geek() { // Return the width of Input Image field let txt = document.getElementById( "myImage").width; document.getElementById( "Geek_h").innerHTML = txt; } </script> </body> </html> Output: Example 2: This Example sets the Input Image width Property. HTML <!DOCTYPE html> <html> <head> <title> HTML DOM Input Image width Property </title> </head> <body style="text-align:center;"> <h1 style="color:green;"> GeeksforGeeks </h1> <h4> DOM Input Image width Property </h4> <button onclick="my_geek()"> <input id="myImage" type="image" src= "https://media.geeksforgeeks.org/wp-content/uploads/gfg-40.png" alt="Submit" formaction="#" formtarget="#" formenctype="text/plain" width="48" height="48"> </button> <h2 id="Geek_h" style="color:green;"></h2> <script> function my_geek() { // change the width of Input Image field let txt = document.getElementById( "myImage").width = "96"; document.getElementById( "Geek_h").innerHTML = txt; } </script> </body> </html> Output: Supported Browsers: The browsers supported by HTML DOM Input Image width Property are listed below: Google ChromeEdge 12+FirefoxOperaSafari Comment More infoAdvertise with us Next Article HTML | DOM Input Image type Property M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML Web technologies HTML-DOM Similar Reads HTML DOM Image width Property The HTML DOM Image width Property is used to set or return the value of the width attribute of the <img> element. It returns a numeric value in terms of pixels. Syntax: It returns the width property. imageObject.width It sets the width property. imageObject.width = pixels Property Values: pixe 2 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 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 name Property 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.nam 2 min read HTML | DOM Object width Property The DOM Object width Property in HTML DOM is used to set or return the width of the Object. The width attribute is used to specify the width of an Object. Syntax: It returns the width property. objObject.widthIt is used to set the width property. objObject.width = pixels Property Values: It contains 2 min read HTML | DOM Input image autofocus Property The HTML DOM input Image autofocus Property is used to set or return whether the Input Image Field should get focus or not when the page loading. It reflects the HTML autofocus attribute. Syntax: It returns the autofocus property.imageObject.autofocusIt is used to set the autofocus property.imageObj 2 min read Like