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`
(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.
Returns a USVString representing the URL from which the currently image was loaded. This may change as the image is adjusted due changing conditions, as directed by any media queries which are place.
Property. Returns a USVString representing the URL from which the currently image was loaded. This may change as the image is adjusted due changing conditions, as directed by any media queries which are place.
(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.
An integer value that reflects the height HTML attribute, indicating rendered height of the image in CSS pixels.
Property. An integer value that reflects the height HTML attribute, indicating rendered height of the image in CSS pixels.
(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.
Returns an integer value representing the intrinsic height of image in CSS pixels, if it is available; else, it shows 0. This the height the image would be if it were rendered at its natural size.
Property. Returns an integer value representing the intrinsic height of image in CSS pixels, if it is available; else, it shows 0. This the height the image would be if it were rendered at its natural size.
(natural-width this)
Property.
An integer value representing the intrinsic width of the image CSS pixels, if it is available; otherwise, it will show 0. This the width the image would be if it were rendered at its natural size.
Property. An integer value representing the intrinsic width of the image CSS pixels, if it is available; otherwise, it will show 0. This the width the image would be if it were rendered at its natural size.
(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-current-src! this val)
Property.
Returns a USVString representing the URL from which the currently image was loaded. This may change as the image is adjusted due changing conditions, as directed by any media queries which are place.
Property. Returns a USVString representing the URL from which the currently image was loaded. This may change as the image is adjusted due changing conditions, as directed by any media queries which are place.
(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.
An integer value that reflects the height HTML attribute, indicating rendered height of the image in CSS pixels.
Property. An integer value that reflects the height HTML attribute, indicating rendered height of the image in CSS pixels.
(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-natural-height! this val)
Property.
Returns an integer value representing the intrinsic height of image in CSS pixels, if it is available; else, it shows 0. This the height the image would be if it were rendered at its natural size.
Property. Returns an integer value representing the intrinsic height of image in CSS pixels, if it is available; else, it shows 0. This the height the image would be if it were rendered at its natural size.
(set-natural-width! this val)
Property.
An integer value representing the intrinsic width of the image CSS pixels, if it is available; otherwise, it will show 0. This the width the image would be if it were rendered at its natural size.
Property. An integer value representing the intrinsic width of the image CSS pixels, if it is available; otherwise, it will show 0. This the width the image would be if it were rendered at its natural size.
(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.
A DOMString reflecting the sizes HTML attribute. This string a list of comma-separated conditional sizes for the image; that for a given viewport size, a particular image size is to be used. the documentation on the sizes page for details on the format this string.
Property. A DOMString reflecting the sizes HTML attribute. This string a list of comma-separated conditional sizes for the image; that for a given viewport size, a particular image size is to be used. the documentation on the sizes page for details on the format this string.
(set-src! this val)
Property.
A USVString that reflects the src HTML attribute, which contains full URL of the image including base URI. You can load a different into the element by changing the URL in the src attribute.
Property. A USVString that reflects the src HTML attribute, which contains full URL of the image including base URI. You can load a different into the element by changing the URL in the src attribute.
(set-srcset! this val)
Property.
A USVString reflecting the srcset HTML attribute. This specifies list of candidate images, separated by commas (',', U+002C COMMA). candidate image is a URL followed by a space, followed by a specially-formatted indicating the size of the image. The size may be specified either width or a size multiple. Read the srcset page for specifics the format of the size substring.
Property. A USVString reflecting the srcset HTML attribute. This specifies list of candidate images, separated by commas (',', U+002C COMMA). candidate image is a URL followed by a space, followed by a specially-formatted indicating the size of the image. The size may be specified either width or a size multiple. Read the srcset page for specifics the format of the size substring.
(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.
An integer value that reflects the width HTML attribute, indicating rendered width of the image in CSS pixels.
Property. An integer value that reflects the width HTML attribute, indicating rendered width of the image in CSS pixels.
(sizes this)
Property.
A DOMString reflecting the sizes HTML attribute. This string a list of comma-separated conditional sizes for the image; that for a given viewport size, a particular image size is to be used. the documentation on the sizes page for details on the format this string.
Property. A DOMString reflecting the sizes HTML attribute. This string a list of comma-separated conditional sizes for the image; that for a given viewport size, a particular image size is to be used. the documentation on the sizes page for details on the format this string.
(src this)
Property.
A USVString that reflects the src HTML attribute, which contains full URL of the image including base URI. You can load a different into the element by changing the URL in the src attribute.
Property. A USVString that reflects the src HTML attribute, which contains full URL of the image including base URI. You can load a different into the element by changing the URL in the src attribute.
(srcset this)
Property.
A USVString reflecting the srcset HTML attribute. This specifies list of candidate images, separated by commas (',', U+002C COMMA). candidate image is a URL followed by a space, followed by a specially-formatted indicating the size of the image. The size may be specified either width or a size multiple. Read the srcset page for specifics the format of the size substring.
Property. A USVString reflecting the srcset HTML attribute. This specifies list of candidate images, separated by commas (',', U+002C COMMA). candidate image is a URL followed by a space, followed by a specially-formatted indicating the size of the image. The size may be specified either width or a size multiple. Read the srcset page for specifics the format of the size substring.
(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.
An integer value that reflects the width HTML attribute, indicating rendered width of the image in CSS pixels.
Property. An integer value that reflects the width HTML attribute, indicating rendered width of the image in CSS pixels.
(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