<input> - image
HTML DOM Input Image object
Input Image object
An Input Image object represents an HTML <input> element using the type="image" element.
Access the Input Image object
You can use the getElementById() function to access <input> elements with the type="image" attribute:
var x = document.getElementById("myImage");
Tip: You can also access the Input Datetime object through the form's elements collection.
Create an Input Image object
You can use the document.createElement() method to create an <input> element with the type="image" attribute:
var x = document.createElement("INPUT");
x.setAttribute("type", "image");
Input Image object attributes
= HTML5 new attribute.
Attribute | Description |
---|---|
alt | Sets or returns the alt attribute value of the input image |
autofocus![]() | Sets or returns whether the input image automatically gets the focus after the page loads |
defaultValue | Sets or returns the input image default value |
disabled | Sets or returns whether 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![]() | Set or return form-data whether it should be validated at commit time |
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 input image |
value | Sets or returns the value of the value attribute of the input image |
width![]() | Sets or returns the width attribute value of the input image |
Standard Properties and Events
Input Datetime objects also support standard properties and events .
Related articles
HTML Tutorial: HTML Forms
HTML Reference Manual: HTML <input> Tag
HTML Reference Manual: HTML <input> type attribute