YouTip LogoYouTip

Dom Obj Input Image

# HTML DOM Input Image Object * * * ## Input Image Object The Input Image Object represents the HTML `` element with `type="image"`. ### Accessing the Input Image Object You can use the `getElementById()` function to access an `` element with the `type="image"` attribute: ```javascript var x = document.getElementById("myImage"); **Tip:** You can also access the Input Image Object through the form's (#) collection. ### Creating an Input Image Object You can use the `document.createElement()` method to create an `` element with the `type="image"` attribute: ```javascript var x = document.createElement("INPUT"); x.setAttribute("type", "image"); ## Input Image Object Properties = Property added in HTML5. | Property | Description | | --- | --- | | alt | Sets or returns the value of the alt attribute of the input image | | autofocus | Sets or returns whether the input image should automatically get focus when the page loads | | defaultValue | Sets or returns the default value of the input image | | disabled | Sets or returns whether the input image is disabled | | form | Returns a reference to the form that contains the input image | | formAction | Sets or returns the value of the formaction attribute of the input image | | formEnctype | Sets or returns the value of the formenctype attribute of the input image | | formMethod | Sets or returns the value of the formmethod attribute of the input image | | formNoValidate | Sets or returns whether the form-data should be validated when submitted | | formTarget | Sets or returns the value of the formtarget attribute of the input image | | height | Sets or returns the value of the height attribute of the input image | | name | Sets or returns the value of the name attribute of the input image | | src | Sets or returns the value of the src attribute of the input image | | type | Returns the form element type of the input image | | value | Sets or returns the value of the value attribute of the input image | | width | Sets or returns the value of the width attribute of the input image | ## Standard Properties and Events The Input Image Object also supports standard (#) and (#). * * * ## Related Articles HTML Tutorial: (#) HTML Reference: (#) HTML Reference: (#)
← Dom Obj MonthProp Email Value β†’