The HTMLImageElement interface represents an HTML <img>
element,
the properties and methods used to manipulate image elements.
The HTMLImageElement interface represents an HTML `<img>` element, the properties and methods used to manipulate image elements.
(align this)
Property.
A DOMString indicating the alignment of the image with respect the surrounding context. The possible values are "left", "right", and "center". This is obsolete; you should instead use CSS (such text-align, which works with images despite its name) to specify alignment.
Property. A DOMString indicating the alignment of the image with respect the surrounding context. The possible values are "left", "right", and "center". This is obsolete; you should instead use CSS (such text-align, which works with images despite its name) to specify alignment.
(alt this)
Property.
The web.dom.HTMLImageElement
property alt provides fallback
text to display when the image specified by the <img>
element
not loaded.
htmlImageElement.alt = altText; let altText = htmlImageElement.alt;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt
Property. The `web.dom.HTMLImageElement` property alt provides fallback text to display when the image specified by the `<img>` element not loaded. `htmlImageElement.alt = altText; let altText = htmlImageElement.alt;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt`
(border this)
Property.
A DOMString which defines the width of the border surrounding image. This is deprecated; use the CSS border property instead.
Property. A DOMString which defines the width of the border surrounding image. This is deprecated; use the CSS border property instead.
(complete this)
Property.
[Read Only]
The read-only web.dom.HTMLImageElement
interface's complete
is a Boolean value which indicates whether or not the image has
loaded.
let doneLoading = htmlImageElement.complete;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/complete
Property. [Read Only] The read-only `web.dom.HTMLImageElement` interface's complete is a Boolean value which indicates whether or not the image has loaded. `let doneLoading = htmlImageElement.complete;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/complete`
(constructor & args)
Constructor.
The Image() constructor creates a new web.dom.HTMLImageElement
instance. It is functionally equivalent to document.createElement('img')
.
Note: The entire bitmap is loaded regardless of the sizes specified in the constructor. The size specified in the constructor is reflected through the properties HTMLImageElement.width
and HTMLImageElement.height
of the resulting instance. The intrinsic width and height of the image in CSS pixels is reflected through the properties HTMLImageElement.naturalWidth
and HTMLImageElement.naturalHeight
. If no size is specified in the constructor both pairs of properties have the same values.
width The width of the image (i.e., the value for the width attribute). height The height of the image (i.e., the value for the height attribute).
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image
Constructor. The Image() constructor creates a new `web.dom.HTMLImageElement` instance. It is functionally equivalent to `document.createElement('img')`. Note: The entire bitmap is loaded regardless of the sizes specified in the constructor. The size specified in the constructor is reflected through the properties `HTMLImageElement.width` and `HTMLImageElement.height` of the resulting instance. The intrinsic width and height of the image in CSS pixels is reflected through the properties `HTMLImageElement.naturalWidth` and `HTMLImageElement.naturalHeight`. If no size is specified in the constructor both pairs of properties have the same values. width The width of the image (i.e., the value for the width attribute). height The height of the image (i.e., the value for the height attribute). See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image`
(cross-origin this)
Property.
The web.dom.HTMLImageElement
interface's crossOrigin attribute
a string which specifies the Cross-Origin Resource Sharing (CORS)
to use when retrieving the image.
htmlImageElement.crossOrigin = crossOriginMode; let crossOriginMode = htmlImageElement.crossOrigin;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/crossOrigin
Property. The `web.dom.HTMLImageElement` interface's crossOrigin attribute a string which specifies the Cross-Origin Resource Sharing (CORS) to use when retrieving the image. `htmlImageElement.crossOrigin = crossOriginMode; let crossOriginMode = htmlImageElement.crossOrigin;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/crossOrigin`
(current-src this)
Property.
[Read Only]
The read-only web.dom.HTMLImageElement
property currentSrc
the URL of the image which is currently presented in the <img>
it represents.
let currentSource = htmlImageElement.currentSrc;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/currentSrc
Property. [Read Only] The read-only `web.dom.HTMLImageElement` property currentSrc the URL of the image which is currently presented in the `<img>` it represents. `let currentSource = htmlImageElement.currentSrc;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/currentSrc`
(decode this)
Method.
The decode() method of the web.dom.HTMLImageElement
interface
a js.Promise
that resolves when the image is decoded and it
safe to append the image to the DOM.
var promise = HTMLImageElement.decode();
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decode
Method. The decode() method of the `web.dom.HTMLImageElement` interface a `js.Promise` that resolves when the image is decoded and it safe to append the image to the DOM. `var promise = HTMLImageElement.decode();` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decode`
(decoding this)
Property.
The decoding property of the web.dom.HTMLImageElement
interface
a hint given to the browser on how it should decode the image.
refStr = imgElem.decoding; imgElem.decoding = refStr;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decoding
Property. The decoding property of the `web.dom.HTMLImageElement` interface a hint given to the browser on how it should decode the image. `refStr = imgElem.decoding; imgElem.decoding = refStr;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decoding`
(height this)
Property.
The height property of the web.dom.HTMLImageElement
interface
the height at which the image is drawn, in CSS pixels if the
is being drawn or rendered to any visual medium such as the screen
a printer; otherwise, it's the natural, pixel density corrected
of the image.
htmlImageElement.height = newHeight; let height = htmlImageElement.height;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height
Property. The height property of the `web.dom.HTMLImageElement` interface the height at which the image is drawn, in CSS pixels if the is being drawn or rendered to any visual medium such as the screen a printer; otherwise, it's the natural, pixel density corrected of the image. `htmlImageElement.height = newHeight; let height = htmlImageElement.height;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height`
(hspace this)
Property.
An integer value which specifies the amount of space (in pixels) leave empty on the left and right sides of the image.
Property. An integer value which specifies the amount of space (in pixels) leave empty on the left and right sides of the image.
(is-map this)
Property.
A Boolean that reflects the ismap HTML attribute, indicating the image is part of a server-side image map. This is different a client-side image map, specified using an <img> element and corresponding <map> which contains <area> elements indicating clickable areas in the image. The image must be contained within <a> element; see the ismap page for details.
Property. A Boolean that reflects the ismap HTML attribute, indicating the image is part of a server-side image map. This is different a client-side image map, specified using an <img> element and corresponding <map> which contains <area> elements indicating clickable areas in the image. The image must be contained within <a> element; see the ismap page for details.
(long-desc this)
Property.
A USVString specifying the URL at which a long description of image's contents may be found. This is used to turn the image a hyperlink automatically. Modern HTML should instead simply an <img> inside an <a> element defining the hyperlink.
Property. A USVString specifying the URL at which a long description of image's contents may be found. This is used to turn the image a hyperlink automatically. Modern HTML should instead simply an <img> inside an <a> element defining the hyperlink.
(low-src this)
Property.
A USVString specifying the URL of a low-quality (but faster to version of the same image. This was once used by browsers under network conditions or on slow devices.
Property. A USVString specifying the URL of a low-quality (but faster to version of the same image. This was once used by browsers under network conditions or on slow devices.
(name this)
Property.
A DOMString representing the name of the element.
Property. A DOMString representing the name of the element.
(natural-height this)
Property.
[Read Only]
The web.dom.HTMLImageElement
interface's naturalHeight property
a read-only value which returns the intrinsic (natural), density-corrected
of the image in CSS pixels.
let naturalHeight = htmlImageElement.naturalHeight;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/naturalHeight
Property. [Read Only] The `web.dom.HTMLImageElement` interface's naturalHeight property a read-only value which returns the intrinsic (natural), density-corrected of the image in CSS pixels. `let naturalHeight = htmlImageElement.naturalHeight;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/naturalHeight`
(natural-width this)
Property.
[Read Only]
The web.dom.HTMLImageElement
interface's read-only naturalWidth
returns the intrinsic (natural), density-corrected width of the
in CSS pixels.
let naturalWidth = htmlImageElement.naturalWidth;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/naturalWidth
Property. [Read Only] The `web.dom.HTMLImageElement` interface's read-only naturalWidth returns the intrinsic (natural), density-corrected width of the in CSS pixels. `let naturalWidth = htmlImageElement.naturalWidth;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/naturalWidth`
(referrer-policy this)
Property.
The HTMLImageElement.referrerPolicy property reflects the HTML
attribute of the <img>
element defining which referrer is sent
fetching the resource.
refStr = imgElt.referrerPolicy; imgElt.referrerPolicy = refStr;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/referrerPolicy
Property. The HTMLImageElement.referrerPolicy property reflects the HTML attribute of the `<img>` element defining which referrer is sent fetching the resource. `refStr = imgElt.referrerPolicy; imgElt.referrerPolicy = refStr;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/referrerPolicy`
(set-align! this val)
Property.
A DOMString indicating the alignment of the image with respect the surrounding context. The possible values are "left", "right", and "center". This is obsolete; you should instead use CSS (such text-align, which works with images despite its name) to specify alignment.
Property. A DOMString indicating the alignment of the image with respect the surrounding context. The possible values are "left", "right", and "center". This is obsolete; you should instead use CSS (such text-align, which works with images despite its name) to specify alignment.
(set-alt! this val)
Property.
The web.dom.HTMLImageElement
property alt provides fallback
text to display when the image specified by the <img>
element
not loaded.
htmlImageElement.alt = altText; let altText = htmlImageElement.alt;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt
Property. The `web.dom.HTMLImageElement` property alt provides fallback text to display when the image specified by the `<img>` element not loaded. `htmlImageElement.alt = altText; let altText = htmlImageElement.alt;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt`
(set-border! this val)
Property.
A DOMString which defines the width of the border surrounding image. This is deprecated; use the CSS border property instead.
Property. A DOMString which defines the width of the border surrounding image. This is deprecated; use the CSS border property instead.
(set-cross-origin! this val)
Property.
The web.dom.HTMLImageElement
interface's crossOrigin attribute
a string which specifies the Cross-Origin Resource Sharing (CORS)
to use when retrieving the image.
htmlImageElement.crossOrigin = crossOriginMode; let crossOriginMode = htmlImageElement.crossOrigin;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/crossOrigin
Property. The `web.dom.HTMLImageElement` interface's crossOrigin attribute a string which specifies the Cross-Origin Resource Sharing (CORS) to use when retrieving the image. `htmlImageElement.crossOrigin = crossOriginMode; let crossOriginMode = htmlImageElement.crossOrigin;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/crossOrigin`
(set-decoding! this val)
Property.
The decoding property of the web.dom.HTMLImageElement
interface
a hint given to the browser on how it should decode the image.
refStr = imgElem.decoding; imgElem.decoding = refStr;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decoding
Property. The decoding property of the `web.dom.HTMLImageElement` interface a hint given to the browser on how it should decode the image. `refStr = imgElem.decoding; imgElem.decoding = refStr;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decoding`
(set-height! this val)
Property.
The height property of the web.dom.HTMLImageElement
interface
the height at which the image is drawn, in CSS pixels if the
is being drawn or rendered to any visual medium such as the screen
a printer; otherwise, it's the natural, pixel density corrected
of the image.
htmlImageElement.height = newHeight; let height = htmlImageElement.height;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height
Property. The height property of the `web.dom.HTMLImageElement` interface the height at which the image is drawn, in CSS pixels if the is being drawn or rendered to any visual medium such as the screen a printer; otherwise, it's the natural, pixel density corrected of the image. `htmlImageElement.height = newHeight; let height = htmlImageElement.height;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height`
(set-hspace! this val)
Property.
An integer value which specifies the amount of space (in pixels) leave empty on the left and right sides of the image.
Property. An integer value which specifies the amount of space (in pixels) leave empty on the left and right sides of the image.
(set-is-map! this val)
Property.
A Boolean that reflects the ismap HTML attribute, indicating the image is part of a server-side image map. This is different a client-side image map, specified using an <img> element and corresponding <map> which contains <area> elements indicating clickable areas in the image. The image must be contained within <a> element; see the ismap page for details.
Property. A Boolean that reflects the ismap HTML attribute, indicating the image is part of a server-side image map. This is different a client-side image map, specified using an <img> element and corresponding <map> which contains <area> elements indicating clickable areas in the image. The image must be contained within <a> element; see the ismap page for details.
(set-long-desc! this val)
Property.
A USVString specifying the URL at which a long description of image's contents may be found. This is used to turn the image a hyperlink automatically. Modern HTML should instead simply an <img> inside an <a> element defining the hyperlink.
Property. A USVString specifying the URL at which a long description of image's contents may be found. This is used to turn the image a hyperlink automatically. Modern HTML should instead simply an <img> inside an <a> element defining the hyperlink.
(set-low-src! this val)
Property.
A USVString specifying the URL of a low-quality (but faster to version of the same image. This was once used by browsers under network conditions or on slow devices.
Property. A USVString specifying the URL of a low-quality (but faster to version of the same image. This was once used by browsers under network conditions or on slow devices.
(set-name! this val)
Property.
A DOMString representing the name of the element.
Property. A DOMString representing the name of the element.
(set-referrer-policy! this val)
Property.
The HTMLImageElement.referrerPolicy property reflects the HTML
attribute of the <img>
element defining which referrer is sent
fetching the resource.
refStr = imgElt.referrerPolicy; imgElt.referrerPolicy = refStr;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/referrerPolicy
Property. The HTMLImageElement.referrerPolicy property reflects the HTML attribute of the `<img>` element defining which referrer is sent fetching the resource. `refStr = imgElt.referrerPolicy; imgElt.referrerPolicy = refStr;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/referrerPolicy`
(set-sizes! this val)
Property.
The web.dom.HTMLImageElement
property sizes allows you to specify
layout width of the image for each of a list of media conditions.
provides the ability to automatically select among different
images of different orientations or aspect ratios—as the document
changes to match different media conditions.
let sizes = htmlImageElement.sizes; htmlImageElement.sizes = sizes;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/sizes
Property. The `web.dom.HTMLImageElement` property sizes allows you to specify layout width of the image for each of a list of media conditions. provides the ability to automatically select among different images of different orientations or aspect ratios—as the document changes to match different media conditions. `let sizes = htmlImageElement.sizes; htmlImageElement.sizes = sizes;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/sizes`
(set-src! this val)
Property.
The web.dom.HTMLImageElement
property src, which reflects the
src attribute, specifies the image to display in the <img>
htmlImageElement.src = newSource; let src = htmlImageElement.src;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/src
Property. The `web.dom.HTMLImageElement` property src, which reflects the src attribute, specifies the image to display in the `<img>` `htmlImageElement.src = newSource; let src = htmlImageElement.src;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/src`
(set-srcset! this val)
Property.
The web.dom.HTMLImageElement
property srcset is a string which
one or more image candidate strings, separated using commas (,)
specifying image resources to use under given circumstances.
htmlImageElement.srcset = imageCandidateStrings; let srcset = htmlImageElement.srcset;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset
Property. The `web.dom.HTMLImageElement` property srcset is a string which one or more image candidate strings, separated using commas (,) specifying image resources to use under given circumstances. `htmlImageElement.srcset = imageCandidateStrings; let srcset = htmlImageElement.srcset;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset`
(set-use-map! this val)
Property.
A DOMString reflecting the usemap HTML attribute, containing page-local URL of the <map> element describing the image map use. The page-local URL is a pound (hash) symbol (#) followed the ID of the <map> element, such as #my-map-element. The <map> turn contains <area> elements indicating the clickable areas the image.
Property. A DOMString reflecting the usemap HTML attribute, containing page-local URL of the <map> element describing the image map use. The page-local URL is a pound (hash) symbol (#) followed the ID of the <map> element, such as #my-map-element. The <map> turn contains <area> elements indicating the clickable areas the image.
(set-vspace! this val)
Property.
An integer value specifying the amount of empty space, in pixels, leave above and below the image.
Property. An integer value specifying the amount of empty space, in pixels, leave above and below the image.
(set-width! this val)
Property.
The width property of the web.dom.HTMLImageElement
interface
the width at which the image is drawn, in CSS pixels if the image
being drawn or rendered to any visual medium such as the screen
a printer; otherwise, it's the natural, pixel density corrected
of the image.
htmlImageElement.width = newWidth; let width = htmlImageElement.width;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width
Property. The width property of the `web.dom.HTMLImageElement` interface the width at which the image is drawn, in CSS pixels if the image being drawn or rendered to any visual medium such as the screen a printer; otherwise, it's the natural, pixel density corrected of the image. `htmlImageElement.width = newWidth; let width = htmlImageElement.width;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width`
(sizes this)
Property.
The web.dom.HTMLImageElement
property sizes allows you to specify
layout width of the image for each of a list of media conditions.
provides the ability to automatically select among different
images of different orientations or aspect ratios—as the document
changes to match different media conditions.
let sizes = htmlImageElement.sizes; htmlImageElement.sizes = sizes;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/sizes
Property. The `web.dom.HTMLImageElement` property sizes allows you to specify layout width of the image for each of a list of media conditions. provides the ability to automatically select among different images of different orientations or aspect ratios—as the document changes to match different media conditions. `let sizes = htmlImageElement.sizes; htmlImageElement.sizes = sizes;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/sizes`
(src this)
Property.
The web.dom.HTMLImageElement
property src, which reflects the
src attribute, specifies the image to display in the <img>
htmlImageElement.src = newSource; let src = htmlImageElement.src;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/src
Property. The `web.dom.HTMLImageElement` property src, which reflects the src attribute, specifies the image to display in the `<img>` `htmlImageElement.src = newSource; let src = htmlImageElement.src;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/src`
(srcset this)
Property.
The web.dom.HTMLImageElement
property srcset is a string which
one or more image candidate strings, separated using commas (,)
specifying image resources to use under given circumstances.
htmlImageElement.srcset = imageCandidateStrings; let srcset = htmlImageElement.srcset;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset
Property. The `web.dom.HTMLImageElement` property srcset is a string which one or more image candidate strings, separated using commas (,) specifying image resources to use under given circumstances. `htmlImageElement.srcset = imageCandidateStrings; let srcset = htmlImageElement.srcset;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/srcset`
(use-map this)
Property.
A DOMString reflecting the usemap HTML attribute, containing page-local URL of the <map> element describing the image map use. The page-local URL is a pound (hash) symbol (#) followed the ID of the <map> element, such as #my-map-element. The <map> turn contains <area> elements indicating the clickable areas the image.
Property. A DOMString reflecting the usemap HTML attribute, containing page-local URL of the <map> element describing the image map use. The page-local URL is a pound (hash) symbol (#) followed the ID of the <map> element, such as #my-map-element. The <map> turn contains <area> elements indicating the clickable areas the image.
(vspace this)
Property.
An integer value specifying the amount of empty space, in pixels, leave above and below the image.
Property. An integer value specifying the amount of empty space, in pixels, leave above and below the image.
(width this)
Property.
The width property of the web.dom.HTMLImageElement
interface
the width at which the image is drawn, in CSS pixels if the image
being drawn or rendered to any visual medium such as the screen
a printer; otherwise, it's the natural, pixel density corrected
of the image.
htmlImageElement.width = newWidth; let width = htmlImageElement.width;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width
Property. The width property of the `web.dom.HTMLImageElement` interface the width at which the image is drawn, in CSS pixels if the image being drawn or rendered to any visual medium such as the screen a printer; otherwise, it's the natural, pixel density corrected of the image. `htmlImageElement.width = newWidth; let width = htmlImageElement.width;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width`
(x this)
Property.
[Read Only]
The read-only web.dom.HTMLImageElement
property x indicates
x-coordinate of the <img>
element's left border edge relative
the root element's origin.
let imageX = htmlImageElement.x;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/x
Property. [Read Only] The read-only `web.dom.HTMLImageElement` property x indicates x-coordinate of the `<img>` element's left border edge relative the root element's origin. `let imageX = htmlImageElement.x;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/x`
(y this)
Property.
[Read Only]
The read-only web.dom.HTMLImageElement
property y indicates
y-coordinate of the <img>
element's top border edge relative
the root element's origin.
let imageY = htmlImageElement.y;
See also: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/y
Property. [Read Only] The read-only `web.dom.HTMLImageElement` property y indicates y-coordinate of the `<img>` element's top border edge relative the root element's origin. `let imageY = htmlImageElement.y;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/y`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close