Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML DOM Input Image object


May 06, 2021 JavaScript with HTML DOM Reference book


Table of contents


HTML DOM Input Image object


Input Image object

The Input Image object represents the HTML-lt;input-gt; element that uses the type-"image" element.

Access the Input Image object

You can use the getElementById() function to access the elements that use the type-"image" property:

var x = document.getElementById("myImage");

Tip: You can also access the Input Datetime object through the form's collection of elements.

Create an Input Image object

You can use the document.createElement() method to create an element that uses the type-"image" property:

var x = document.createElement("INPUT");
x.setAttribute("type", "image");

Input Image object properties

New properties for HTML5.
Property describe
alt Set or return the Alt property value of INPUT Image
autofocus Set or return to invut image to automatically get focus after loading
defaultValue Set or return to the input image default value
disabled Set or return to whether IMAGE is disabled
form Returns a form reference to INPUT Image
formAction Set or return the formAction property value of Input Image
formEnctype Set or return Forment IMAGENCTYPE attribute values
formMethod Set or return the FormMethod property value of Input Image
formNoValidate Set or return to Form-Data whether it should be verified when submitting
formTarget Set or return the FormTarget property value of Input Image
height Set or return the Height property value of INPUT Image
name Set or return the name attribute value of Input Image
src Set or return the src attribute value of INPUT Image
type Returns the type element type for Input Image
value Set or return the value attribute value of Input Image
width Set or return the width property value of 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 slt;input.gt; Tags

HTML Reference Manual: HTML slt;input> type property